I got error messages while building `cppcheck 2.12.0` for RISC-V Arch
Linux:
```
Testing Complete
Number of tests: 4420
Number of todos: 331
Tests failed: 2
/usr/src/debug/cppcheck/cppcheck/test/testcondition.cpp:4501(TestCondition::alwaysTrue): Assertion failed.
Expected:
[test.cpp:6]: (style) Condition 'o[1]=='\0'' is always false\n
Actual:
[test.cpp:4] -> [test.cpp:6]: (style) Condition 'o[1]=='\0'' is always false\n
_____
/usr/src/debug/cppcheck/cppcheck/test/testcondition.cpp:5014(TestCondition::alwaysTrueContainer): Assertion failed.
Expected:
[test.cpp:5]: (style) Condition 'buffer.back()=='\0'' is always false\n
Actual:
[test.cpp:3] -> [test.cpp:5]: (style) Condition 'buffer.back()=='\0'' is always false\n
```
I found out the reason is that the testcases were designed for
x86/x86_64 or other `signed char` platforms (i.e. default character type
is `signed char` ), whereareas RISC-V is an `unsigned char` platform,
which causes different behavior in
`lib/valueflow.cpp:valueFlowImpossibleValues`. I'm not sure whether this
error leads from a functional bug, so if you have a better approach to
fix it, please let me know.
Maybe you could reproduce this error on x86_64 platform by setting
`defaultSign = 'u';` in `Platform::set(Type t)`.
This adds a new checker to check for pointer to bool conversions that
are always known. I removed the previous knownConditionTrueFalse checks
since this was too noisy.
There was no need for the `Tokenizer` parameter to be a pointer as it
could never be `nullptr` and was also dereferenced without checking
first.
As a reference to the `Settings` was already available via the
`Tokenizer` there was no need to pass it separately. In the production
code there will only be one instance of it but in the tests we could
have accidentally passed a different one.
This is a mess. The version is AUR is still outdated and also doesn't
install anymore. Fedora 38 carries the latest version of it so use that
now. Keep the old steps in case we need to switch again in the future.
* Preprocessor: cleaned up `missingInclude()`
* Preprocessor: relaxed dependency on `Suppressions` / adjusted `TestPreProcessor::inline_suppression_for_missing_include()` which was not testing production behavior
* test/cli/test-other.py: added test for `missingInclude` and `missingIncludeSystem` inline suppressions
* fixed `constParameterReference` selfcheck warning
* Fix#11558 FP knownConditionTrueFalse when checking for zero characte
* Fix test
* Set impossible value only for non-Boolean conditions, rename
* Fix condition
* fixture.h: added TODO
* TestPlatform: improved tests for built-in platforms
* TestPlatform: changed tests to TODO asserts
* testfilelister.cpp: added TODO
* fixture.h: added `PLATFORM` macro to load platform / use `PLATFORM` in tests
* platform.h: corrected capitalization in `Platform::platformString(PlatformType)` and bail on unknown type
* fixture.h: fixed `readability-redundant-string-cstr` clang-tidy warning
* testplatform.cpp: fixed `functionConst` selfcheck warnings