Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Profiler] Upgrade cppcheck to 2.12 #5398

Merged
merged 2 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .azure-pipelines/ultimate-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 3 additions & 1 deletion profiler/cppcheck-suppressions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
*:*/test/*
*:*/_deps/*
// This error is an issue with cppcheck. So do not report this one specifically
preprocessorErrorDirective:*/logging.h
preprocessorErrorDirective:*/logging.h
cppcheckError:*/StackSamplerLoopManager.cpp
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove missing standard include headers (too noisy). CppCheck folks does not recommend otherwise we might have events from those files (which is not what we want)

missingIncludeSystem:*
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace pmr {
using namespace std::experimental::pmr;
}
#else // Not found at all
// cppcheck-suppress preprocessorErrorDirective
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since CppCheck cannot find <memory_resource> header file, it defaults to #error.
Here we suppress the error because it's not one :)

#error "Missing <memory_resource>"
#endif
#endif
Expand Down
Loading