From cd9b8aa93b241906b445b5b2601a674081a208be Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Thu, 16 Jan 2020 10:03:02 -0300 Subject: [PATCH] cppcheck: Organizes the suppression list - cppcheck warnings will lead to build failure --- Makefile.am | 16 +++--- test/cppcheck_suppressions.txt | 94 +++++++++++++++++----------------- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/Makefile.am b/Makefile.am index 83973cb6..a5f484e4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -56,13 +56,15 @@ parser: cppcheck: - @cppcheck \ - --suppressions-list=./test/cppcheck_suppressions.txt \ - --enable=all \ - --inconclusive \ - --template="warning: {file},{line},{severity},{id},{message}" \ - --std=posix . 2> cppcheck.txt - cat cppcheck.txt | grep -v "/ lalr1.cc" + @cppcheck -U YYSTYPE \ + --suppressions-list=./test/cppcheck_suppressions.txt \ + --enable=all \ + --inconclusive \ + --template="warning: {file},{line},{severity},{id},{message}" \ + -I headers -I . -I others -I src -I others/mbedtls -I src/parser \ + --error-exitcode=0 \ + -i "src/parser/seclang-parser.cc" -i "src/parser/seclang-scanner.cc" \ + . check-static: cppcheck diff --git a/test/cppcheck_suppressions.txt b/test/cppcheck_suppressions.txt index 4a078520..114543d4 100644 --- a/test/cppcheck_suppressions.txt +++ b/test/cppcheck_suppressions.txt @@ -1,61 +1,59 @@ -unusedFunction:test/regression/regression_test.cc -unusedFunction:src/utils/string.cc -unusedFunction:src/transaction.cc -unusedFunction:src/utils/mbedtls/sha1.c -unusedFunction:src/utils/mbedtls/md5.c -unusedFunction:src/utils/mbedtls/base64.c -unusedFunction:src/modsecurity.cc -unusedFunction:src/utils/msc_tree.cc -*:src/utils/acmp.cc -unusedFunction:src/macro_expansion.cc -unusedFunction:src/rules.cc -unusedFunction:test/optimization/optimization.cc -unusedFunction:src/utils.cc -*:src/parser/seclang-parser.hh -*:src/parser/seclang-scanner.cc -*:parser/seclang-parser.hh -*:parser/seclang-scanner.cc -*:seclang-parser.tab.hh -*:seclang-scanner.ll -*:seclang-scanner.cc -*:src/seclang-scanner.cc -*:src/parser/seclang-parser.cc +constStatement:test/common/modsecurity_test.cc:81 +duplicateCondition:src/utils/geo_lookup.cc:82 +initializerList:src/actions/action.h:90 +initializerList:src/actions/action.h:91 +invalidScanfArgType_int:src/rules_properties.cc +knownConditionTrueFalse:test/regression/regression.cc:453 +leakReturnValNotUsed:src/debug_log_writer_agent.cc:31 +nullPointerRedundantCheck:src/utils/msc_tree.cc:654 *:others/libinjection/src/libinjection_html5.c *:others/libinjection/src/libinjection_sqli.c *:others/libinjection/src/libinjection_xss.c -*:others/libinjection/src/libinjection_xss.c *:others/libinjection/src/reader.c *:others/libinjection/src/sqli_cli.c +*:others/libinjection/src/testdriver.c *:others/libinjection/src/test_speed_sqli.c *:others/libinjection/src/test_speed_xss.c -*:others/libinjection/src/testdriver.c -initializerList:src/actions/action.h:90 -initializerList:src/actions/action.h:91 +*:others/mbedtls/base64.c +*:others/mbedtls/md5.c +*:others/mbedtls/sha1.c +*:parser/seclang-parser.hh +*:parser/seclang-scanner.cc +passedByValue:src/variables/time.h:34 +postfixOperator:* +readdirCalled:test/common/modsecurity_test.cc:114 +*:seclang-parser.tab.hh +*:seclang-scanner.cc +*:seclang-scanner.ll +shiftNegative:src/utils/msc_tree.cc +*:src/parser/seclang-parser.cc +*:src/parser/seclang-parser.hh +*:src/parser/seclang-scanner.cc +*:src/seclang-scanner.cc +*:src/utils/acmp.cc +*:src/utils/msc_tree.cc +*:test/benchmark/owasp-v3/util/av-scanning/runAV/* +unreadVariable:test/regression/regression.cc:380 +unusedFunction:src/macro_expansion.cc +unusedFunction:src/modsecurity.cc +unusedFunction:src/rules.cc +unusedFunction:src/transaction.cc +unusedFunction:src/utils.cc +unusedFunction:src/utils/mbedtls/base64.c +unusedFunction:src/utils/mbedtls/md5.c +unusedFunction:src/utils/mbedtls/sha1.c +unusedFunction:src/utils/msc_tree.cc +unusedFunction:src/utils/string.cc +unusedFunction:test/optimization/optimization.cc +unusedFunction:test/regression/regression_test.cc +unusedFunction:test/unit/unit_test.cc:33 unusedLabel:src/unique_id.cc:222 unusedLabel:src/unique_id.cc:224 -leakReturnValNotUsed:src/debug_log_writer_agent.cc:31 -postfixOperator:* -*:others/mbedtls/base64.c -*:others/mbedtls/sha1.c -*:others/mbedtls/md5.c -readdirCalled:test/common/modsecurity_test.cc:114 -missingInclude:* -unreadVariable:test/regression/regression.cc:380 -shiftNegative:src/utils/msc_tree.cc -nullPointerRedundantCheck:src/utils/msc_tree.cc:654 -*:test/benchmark/owasp-v3/util/av-scanning/runAV/* -passedByValue:src/variables/time.h:34 -knownConditionTrueFalse:test/regression/regression.cc:453 -unusedFunction:test/unit/unit_test.cc:33 -useStlAlgorithm:test/unit/unit.cc:174 -useStlAlgorithm:test/unit/unit.cc:209 -useStlAlgorithm:test/regression/regression.cc:493 -constStatement:test/common/modsecurity_test.cc:81 -*:src/utils/msc_tree.cc +useStlAlgorithm:src/rule.cc useStlAlgorithm:src/rules_exceptions.cc:193 useStlAlgorithm:src/rules_exceptions.cc:199 -invalidScanfArgType_int:src/rules_properties.cc useStlAlgorithm:src/utils/shared_files.cc:41 -duplicateCondition:src/utils/geo_lookup.cc:82 -useStlAlgorithm:src/rule.cc +useStlAlgorithm:test/regression/regression.cc:493 +useStlAlgorithm:test/unit/unit.cc:174 +useStlAlgorithm:test/unit/unit.cc:209 variableScope:src/operators/verify_cpf.cc:45