diff --git a/.github/workflows/cpp-build-test-coverage.yml b/.github/workflows/cpp-build-test-coverage.yml index f8ac5bb..4f168bb 100644 --- a/.github/workflows/cpp-build-test-coverage.yml +++ b/.github/workflows/cpp-build-test-coverage.yml @@ -46,6 +46,7 @@ jobs: # Step 2: Run Cppcheck (Static Analysis) # - Scans for common C++ issues (style, memory, logic) # - You can adjust `--enable=` options as needed + # - https://cppcheck.sourceforge.io/manual.pdf # ------------------------------------------------------- - name: Run static analysis with Cppcheck run: | @@ -53,6 +54,7 @@ jobs: cppcheck --enable=warning,style,performance,portability \ --inconclusive \ --quiet \ + --inline-suppr \ --error-exitcode=1 \ ./src ./include diff --git a/src/core/datatypes/class/RoleOfThreeFiveZero.cpp b/src/core/datatypes/class/RoleOfThreeFiveZero.cpp index 8fd7cd4..ac2e173 100644 --- a/src/core/datatypes/class/RoleOfThreeFiveZero.cpp +++ b/src/core/datatypes/class/RoleOfThreeFiveZero.cpp @@ -1,3 +1,5 @@ +// cppcheck-suppress-file [noCopyConstructor, noOperatorEq, accessMoved] + #include #include #include diff --git a/src/core/datatypes/class/SallowDeepCopying.cpp b/src/core/datatypes/class/SallowDeepCopying.cpp index b5bacef..08c391d 100644 --- a/src/core/datatypes/class/SallowDeepCopying.cpp +++ b/src/core/datatypes/class/SallowDeepCopying.cpp @@ -1,3 +1,5 @@ +// cppcheck-suppress-file [noCopyConstructor, noOperatorEq, unsafeClassCanLeak] + #include namespace @@ -35,12 +37,13 @@ namespace } } - int getPtr() + int getPtr() const { if (ptr != nullptr) { return *ptr; } + return 0; } // Implicit copy constructor: Model a{b}; @@ -149,12 +152,13 @@ namespace } } - int getPtr() + int getPtr() const { if (ptr != nullptr) { return *ptr; } + return 0; } };