Skip to content

Fix #771 (Add cppcheck self check and fix cppcheck warnings) - #772

Open
danmar wants to merge 4 commits into
masterfrom
fix-771
Open

danmar wants to merge 4 commits into
masterfrom
fix-771

Conversation

@danmar

@danmar danmar commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

danmar and others added 4 commits November 20, 2026 11:37
- make TokenList::readBlockComment const
- use the same parameter name in the constFoldUnaryNotPosNeg declaration and definition
- rename the expandTrailingCalls callback parameter so it does not shadow gatherCall
- use std::find_if in TokenList::fileIndex
- selfcheck: suppress missingMemberCopy and constParameterReference, drop the unmatched missingIncludeSystem suppression

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@dmcppcheck dmcppcheck left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

AI review

I found no problems. None of the source changes should change behaviour: the member initializers (bom{0}, isUtf16{false}), final on the stream classes, readBlockComment becoming const, the parameter renames and the std::find_if rewrite of fileIndex. readBlockComment is a private member, so making it const doesn't break the API that cppcheck uses. I couldn't run the new cppcheck workflow because the container has no network and no cppcheck.

Testing

  • make -j8 testrunner simplecpp CXXOPTS=-Werror in pr/ built with no warnings.
  • ./testrunner exited with 0.
  • python3 run-tests.py: 176 tests, 0 failed, 21 skipped.
  • python3 -m pytest integration_test.py: 128 passed.
  • ./selfcheck.sh exited with 0.
  • I built base/ and ran both binaries on every testsuite/*.c file. The outputs were the same.
  • A UTF-16LE file with a BOM (#define A 1 / A) gave 1 with both binaries. This checks the BOM and UTF-16 path that the new member initializers touch.
  • Not tested: the GitHub workflow itself. Without network access I couldn't clone or build cppcheck, so I couldn't check that tag 2.22.0 exists or that the self check passes with the given suppressions.

Automated review of e674f99 by Claude. The pull request was built and tested locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants