Skip to content

Fix expected output in TestCondition::alwaysTrue and TestCondition::alwaysTrueContainer#7709

Merged
danmar merged 1 commit intocppcheck-opensource:mainfrom
andreas-schwab:main
Aug 4, 2025
Merged

Fix expected output in TestCondition::alwaysTrue and TestCondition::alwaysTrueContainer#7709
danmar merged 1 commit intocppcheck-opensource:mainfrom
andreas-schwab:main

Conversation

@andreas-schwab
Copy link
Copy Markdown
Contributor

No description provided.

@sonarqubecloud
Copy link
Copy Markdown

@chrchr-github
Copy link
Copy Markdown
Collaborator

Can this be tested using e.g. -funsigned-char?

@andreas-schwab
Copy link
Copy Markdown
Contributor Author

-funsigned-char may change the ABI and thus invokes undefined behaviour.

@chrchr-github
Copy link
Copy Markdown
Collaborator

I was actually thinking of cppcheck's own -funsigned-char switch.

But I see now that we only run a single test (TestSymbolDatabase) in build_uchar (CI-unixish) with unsigned char, so the bad output was not detected. I wonder if we should run all tests?

@danmar
Copy link
Copy Markdown
Collaborator

danmar commented Aug 4, 2025

I wonder if we should run all tests?

it sounds reasonable to me.

however is that related to this PR? the std::numeric_limits<char>::is_signed would still be true no matter which cppcheck options is used?

@chrchr-github
Copy link
Copy Markdown
Collaborator

I wonder if we should run all tests?

it sounds reasonable to me.

however is that related to this PR? the std::numeric_limits<char>::is_signed would still be true no matter which cppcheck options is used?

Yes, -funsigned-charprobably doesn't help here. I hadn't realized that we have build_uchar in the CI, so we should run all tests there.

@danmar danmar merged commit e5efd12 into cppcheck-opensource:main Aug 4, 2025
65 checks passed
@firewave
Copy link
Copy Markdown
Collaborator

Different output depending on build flags feels like a bug to me. It should be platform-agnostic and this should rather be handled in the check than the test.

firewave pushed a commit to firewave/cppcheck that referenced this pull request Sep 2, 2025
firewave added a commit that referenced this pull request Sep 7, 2025
…lwaysTrueContainer (#7709) (#7787)

(cherry picked from commit e5efd12)

Co-authored-by: Andreas Schwab <schwab@linux-m68k.org>
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.

4 participants