From f55a9541f9da2bdb47a2c7e8a9461beff3050c28 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Mon, 30 Mar 2026 12:01:12 +0200 Subject: [PATCH 1/2] fix: cppcheck warning in standalone/server.c; add suppression to whole header's dir --- Makefile.am | 5 +++-- standalone/server.c | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index 79bbbdff2..ad35a1543 100755 --- a/Makefile.am +++ b/Makefile.am @@ -44,12 +44,13 @@ cppcheck: --library=gnu \ --library=posix \ --std=c++17 \ - -I ./apache2 \ + -I ./apache2 \ -I /usr/include/libxml2 \ - -I @APXS_INCLUDEDIR@ \ + -I @APXS_INCLUDEDIR@ \ -I @APR_INCLUDEDIR@ \ -I @APU_INCLUDEDIR@ \ --suppressions-list=./tests/cppcheck_suppressions.txt \ + --suppress=syntaxError:/usr/include/apr-1.0/* \ --inline-suppr \ --inconclusive \ --template="warning: {file},{line},{severity},{id},{message}" \ diff --git a/standalone/server.c b/standalone/server.c index b59344fd2..ac1c423d2 100644 --- a/standalone/server.c +++ b/standalone/server.c @@ -139,16 +139,15 @@ AP_DECLARE(int) ap_index_of_response(int status) { static const int shortcut[6] = {0, LEVEL_200, LEVEL_300, LEVEL_400, LEVEL_500, RESPONSE_CODES}; - int i, pos; if (status < 100) { /* Below 100 is illegal for HTTP status */ return LEVEL_500; } - for (i = 0; i < 5; i++) { + for (int i = 0; i < 5; i++) { status -= 100; if (status < 100) { - pos = (status + shortcut[i]); + int pos = (status + shortcut[i]); if (pos < shortcut[i + 1]) { return pos; } From b0c4a9f4cfb121a69b0fbd96b8aa80fd5c8ae439 Mon Sep 17 00:00:00 2001 From: Ervin Hegedus Date: Mon, 30 Mar 2026 12:21:35 +0200 Subject: [PATCH 2/2] Update Makefile.am Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index ad35a1543..24d9db0a5 100755 --- a/Makefile.am +++ b/Makefile.am @@ -50,7 +50,7 @@ cppcheck: -I @APR_INCLUDEDIR@ \ -I @APU_INCLUDEDIR@ \ --suppressions-list=./tests/cppcheck_suppressions.txt \ - --suppress=syntaxError:/usr/include/apr-1.0/* \ + --suppress=syntaxError:@APR_INCLUDEDIR@/* \ --inline-suppr \ --inconclusive \ --template="warning: {file},{line},{severity},{id},{message}" \