Based on #4701, #5418
A helper function for the `isdigit()` test should be introduced on the
simplecpp side.
Co-authored-by: gerboengels <github@gerbo.org>
This is a warning we found during static analyis with CodeSecure
CodeSonar.
It flagged a suspicious copy-paste error, where it finds code that seems
to have been copied from another location, with some, but not all,
variables substituted.
Unclear to me if this truly is a problem, or intentional, but I wanted
to provide the feedback as I am not sure how to test this.
Lines 5614 to 5619 in lib/symboldatabase.cpp are a copy from 5597-5602
with vartok replaced by valuetok, except for line 5616
We were calling several interface functions through their inherited
classes instead of using the base classes requiring us to add `friend`
declarations to make the implementations accessible. This adjusts
several of those cases.
This should fix at least the following:
```
lib/color.cpp:33:43: debug: valueflow.cpp:10214:valueFlowConditionExpressions bailout: Skipping function due to incomplete variable STDOUT_FILENO [valueFlowBailoutIncompleteVar]
static const bool stdout_tty = isatty(STDOUT_FILENO);
^
```
This makes the code much more readable. It also makes it less prone to
errors because we do not need to specify the length of the string to
match and the returnvalue is clear.
The code with the bad returnvalue check was never executed and I added a
test to show that.
This provides a report of the top incomplete variables reported by the
ValueFlow analysis. This is based on the implementation of the existing
`--check-library` reports.
Windows XP Pro x64 was released on April 25, 2005 and consumer
processors supporting x86-64 have been around almost as long. Although
there are still 32-bit Windows images available there is not much of a
point maintaining support for these. We also never did any x86 builds
for non-Windows platforms in CI so we don't even know if we work on
those. You might still be able to build 32-bit binaries via CMake.
This used to be one of the longest running jobs because of the slow
setup and linking. Now it will take only ~2 minutes if everything is
cached with half the time taken up by the tests.