Add cppcheck static analysis to car/ CI#98
Closed
ltowarek wants to merge 1 commit into
Closed
Conversation
ltowarek
force-pushed
the
cpp_linters_cppcheck
branch
from
June 21, 2026 21:16
bd552c8 to
a6c2da6
Compare
ltowarek
force-pushed
the
cpp_linters_cppcheck
branch
from
June 21, 2026 21:22
a6c2da6 to
bab0dd0
Compare
Runs cppcheck against the production compile_commands.json (no special toolchain needed). Suppresses findings transitively reported on vendored/SDK headers and a handful of confirmed cppcheck parser false positives on ESP-IDF's variadic ESP_LOGx macros, with reasoning inline. Fixes two real const-correctness findings in command_parser.cpp. Part of #87. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QwTBvENKGMczMo9x7nAMrg
ltowarek
force-pushed
the
cpp_linters_cppcheck
branch
from
June 21, 2026 21:34
bab0dd0 to
58312aa
Compare
Owner
Author
|
Closing without merging. While investigating a complaint that the cppcheck-suppress comment above the first ESP_LOGx call per file felt unacceptable, it turned out cppcheck is barely analyzing this codebase at all (4/592 checkers active project-wide) — it aborts each translation unit on its first critical parse error, and nearly every file hits one (either the ESP_LOGx VA_OPT macro or a vendored OTel #error directive). The CI job was passing regardless of actual code quality. #99 has been rebased to sit directly on #97, skipping this branch. Filed #100 with the full diagnosis to revisit cppcheck properly later. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
car/.cppcheck-suppressionsandcar/scripts/run_cppcheck.sh, run via a new blockingcppcheckCI job (added toci-status-cpp-car'sneeds) and wired intocar/scripts/run_checks.sh/pre-commit.sh.compile_commands.jsonfrom a regularidf.py build— the production GCC toolchain, no special toolchain detour needed (unlike clang-tidy).*:*/esp-opentelemetry-cpp/*,*:/opt/esp/idf/*) — not actionable from owned code.// cppcheck-suppress syntaxErrorcomments (4 call sites) for a confirmed cppcheck parser limitation with ESP-IDF's variadicESP_LOGxmacros — verified these are false positives, not real syntax errors (the real GCC build already catches genuine syntax errors).cJSON_GetObjectItem(...)results incommand_parser.cppcan beconst cJSON *(cJSON's own API already takesconst cJSON *, so this is a no-op at the ABI level).Part of #87.
Test plan
./scripts/run_cppcheck.shpasses cleanly (exit 0) from a clean buildCo-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
https://claude.ai/code/session_01QwTBvENKGMczMo9x7nAMrg