diff --git a/run_cppcheck.sh b/run_cppcheck.sh index 5a35fc0..6c52522 100755 --- a/run_cppcheck.sh +++ b/run_cppcheck.sh @@ -5,7 +5,17 @@ RESULTS_FILE=cppcheck-results.log # --force: force checks all define combinations (default max is 12) # -iaws-sdk-cpp: avoid checking AWS C++ SDK source files in our repo # -UWIN32: do not check WIN32-defined codepaths; this would throw errors on Mac -cppcheck --force -iaws-sdk-cpp -UWIN32 ./src 2> ${RESULTS_FILE} +# --check-level: use exhaustive checking for pipeline jobs; can disable during active development for quicker results +# --inline-suppr: enable inline error suppression +# -i: ignore CMake and installed files + +cppcheck \ + --force -iaws-sdk-cpp -UWIN32 \ + --check-level=exhaustive \ + --inline-suppr \ + -i "src/vcpkg_installed" \ + -i "src/cmake-build-debug" \ + ./src 2> ${RESULTS_FILE} if [ -s ${RESULTS_FILE} ]; then echo "!! Cppcheck errors found! Check ${RESULTS_FILE} for details." diff --git a/src/opensearchenlist/msdtc_enlist.cpp b/src/opensearchenlist/msdtc_enlist.cpp index f427d83..3a85716 100644 --- a/src/opensearchenlist/msdtc_enlist.cpp +++ b/src/opensearchenlist/msdtc_enlist.cpp @@ -1111,7 +1111,10 @@ RETCODE static EnlistInDtc_1pipe(void *conn, ITransaction *pTra, case DTC_CHECK_RM_CONNECTION: if (!confirmingLink) { confirmingLink = true; + + // cppcheck-suppress unknownMacro strcat(dtcname, ";" KEYWORD_DTC_CHECK "=0"); + continue; } default: