From d975af75a25974a8740da1eb1c1f77f608a434db Mon Sep 17 00:00:00 2001 From: smathis Date: Tue, 4 Mar 2025 14:45:47 +0100 Subject: [PATCH] Suppress strcpy-related errors on a global level --- .gitlab-ci.yml | 2 +- src/masterMacsAxis.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1d7ee89..eba407c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ stages: cppcheck: stage: lint script: - - cppcheck --std=c++17 --addon=cert --addon=misc --error-exitcode=1 src/*.cpp + - cppcheck --std=c++17 --addon=cert --addon=misc --suppress=cert-STR07-C --error-exitcode=1 src/*.cpp artifacts: expire_in: 1 week tags: diff --git a/src/masterMacsAxis.cpp b/src/masterMacsAxis.cpp index ffb6e19..6edd0b3 100644 --- a/src/masterMacsAxis.cpp +++ b/src/masterMacsAxis.cpp @@ -45,7 +45,6 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage, if (lenToBeAppended < capacityFullMessage) { // We check before that the capacity of fullMessage is sufficient - // cppcheck-suppress cert-STR07-C strcpy(fullMessage, toBeAppended); } } else { @@ -58,7 +57,6 @@ void appendErrorMessage(char *fullMessage, size_t capacityFullMessage, // fullMessage[lenFullMessage + 1] = '\0'; // We check before that the capacity of fullMessage is sufficient - // cppcheck-suppress cert-STR07-C strcat(fullMessage, toBeAppended); } }