From 12937a0a01572431aecf2051068eff5a803b0155 Mon Sep 17 00:00:00 2001 From: Gregory LEOCADIE Date: Thu, 4 Apr 2024 12:48:09 +0200 Subject: [PATCH 1/2] Upgrade cppcheck to 2.12 --- .azure-pipelines/ultimate-pipeline.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 1625ec8dc0dc..edc63f159975 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -1673,14 +1673,12 @@ stages: pool: name: azure-windows-scale-set timeoutInMinutes: 60 #default value - # Temporarily disabled, as current Cppcheck does not support macros - condition: "false" steps: - powershell: | # Required to reload environment apparently Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 - choco install cppcheck -y --version 2.9 + choco install cppcheck -y --version 2.12 $errorCode = $LASTEXITCODE if ($errorCode -ne 0) { From f62186fd515da3c846597a0b8212a6f2368d6045 Mon Sep 17 00:00:00 2001 From: Gregory LEOCADIE Date: Thu, 4 Apr 2024 13:45:23 +0200 Subject: [PATCH 2/2] Add CppCheck suppressions --- profiler/cppcheck-suppressions.txt | 4 +++- .../src/ProfilerEngine/Datadog.Profiler.Native/LinkedList.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/profiler/cppcheck-suppressions.txt b/profiler/cppcheck-suppressions.txt index c3f733297348..c5fece7d3cad 100644 --- a/profiler/cppcheck-suppressions.txt +++ b/profiler/cppcheck-suppressions.txt @@ -3,4 +3,6 @@ *:*/test/* *:*/_deps/* // This error is an issue with cppcheck. So do not report this one specifically -preprocessorErrorDirective:*/logging.h \ No newline at end of file +preprocessorErrorDirective:*/logging.h +cppcheckError:*/StackSamplerLoopManager.cpp +missingIncludeSystem:* diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/LinkedList.hpp b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/LinkedList.hpp index b53f63169389..e6cee3021e90 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/LinkedList.hpp +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/LinkedList.hpp @@ -15,6 +15,7 @@ namespace pmr { using namespace std::experimental::pmr; } #else // Not found at all +// cppcheck-suppress preprocessorErrorDirective #error "Missing " #endif #endif