Skip to content

fix: cppcheck warnings#3530

Merged
fzipi merged 2 commits intoowasp-modsecurity:v2/masterfrom
airween:v2/cppcheck0330
Mar 30, 2026
Merged

fix: cppcheck warnings#3530
fzipi merged 2 commits intoowasp-modsecurity:v2/masterfrom
airween:v2/cppcheck0330

Conversation

@airween
Copy link
Copy Markdown
Member

@airween airween commented Mar 30, 2026

cppcheck warning in standalone/server.c; add suppression to whole header's dir

what

This PR fixes some cppcheck warnings:

  • move variables to inner scope
  • add system's include directory to the suppression list

I prefer this way (second item) because at this way we see the suppression, don't need top check the suppression's file.

why

There were some cppcheck warnings and failed tests in recent PR's.

references

#3527

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses cppcheck failures by reducing variable scope in the standalone Apache compatibility layer and adding an extra cppcheck suppression for APR headers.

Changes:

  • Move loop/index variables in ap_index_of_response() into narrower scopes to satisfy cppcheck warnings.
  • Update the cppcheck Makefile target to add a suppression for syntaxError originating from APR system headers.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
standalone/server.c Narrows variable scope in ap_index_of_response() to eliminate cppcheck warnings.
Makefile.am Adjusts cppcheck invocation and adds an APR header suppression to reduce noise/failures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@airween airween requested a review from fzipi March 30, 2026 11:19
@fzipi fzipi merged commit a86189c into owasp-modsecurity:v2/master Mar 30, 2026
92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants