Commit Graph

27571 Commits

Author SHA1 Message Date
Oliver Stöneberg e47300016b
moved some classes/structs into anonymous namespace () 2023-11-16 15:49:41 +01:00
chrchr-github 63a5a71c20
Fix FN memleak with outparam allocation () 2023-11-16 15:23:40 +01:00
Oliver Stöneberg 9cf0342f9d
optimized `ProgramMemory` a bit ()
Scanning `common/file.c` of the `xrdp` project with `--force --std=c11
--std=c++11 --inline-suppr --enable=warning`:

Clang 16 `4,208,373,435` -> `4,156,024,955`
GCC 13 `4,336,042,153` -> `4,277,293,971`
2023-11-16 14:35:25 +01:00
chrchr-github 85172fe770
Don't report checkLibraryUseIgnore for known functions (refs ) () 2023-11-16 14:23:08 +01:00
Swasti Shrivastava 1ce901385a
Fix #12172:False positive: misra-11.1 function pointer assigned to array () 2023-11-16 13:57:27 +01:00
Oliver Stöneberg 682901ac2a
fixed - added file name to ValueFlow `--debug` output () 2023-11-16 13:44:50 +01:00
Oliver Stöneberg 8b69ccadd4
CppCheckExecutor: extracted logging instance related code into separate implementation class () 2023-11-16 10:35:43 +01:00
Swasti Shrivastava 81a03e7341
Fix : false positive: misra 11.6, cast expression '0U' to 'void*' () 2023-11-16 09:06:58 +01:00
Daniel Marjamäki ae3f7bd800
Fixed (Windows build GUI with cmake) () 2023-11-15 16:56:46 +01:00
Oliver Stöneberg d3a8eb1ae2
config.h: improved and cleaned up some preprocessor checks () 2023-11-15 15:31:12 +01:00
Oliver Stöneberg e7f8985173
disabled some expensive and/or unnecessary clang-tidy checks ()
Running clang-tidy with `--enable-check-profile` provides an overview of
the run-time of each check. This revealed some checks which take a
considerable amount of time which could be disabled.

Here's the times for the checks in question. The times are very similar
across most files:
```
   ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
...
   0.4531 (  4.7%)   0.3906 (  6.1%)   0.8438 (  5.2%)   0.8127 (  5.1%)  misc-unused-using-decls
...
   0.3281 (  3.4%)   0.2344 (  3.7%)   0.5625 (  3.5%)   0.4509 (  2.8%)  modernize-macro-to-enum
...
   0.2188 (  2.2%)   0.2031 (  3.2%)   0.4219 (  2.6%)   0.3621 (  2.3%)  modernize-use-nullptr
```
2023-11-15 11:24:25 +01:00
chrchr-github 3bd5a034bd
Fix false positive: unassignedVariable () 2023-11-14 12:26:12 +01:00
chrchr-github 6ac804d209
Fix extern "C++" scope generates valueflow () 2023-11-14 10:02:41 +01:00
Oliver Stöneberg 9228b9e424
iwyu.yml: fixed `include-what-you-use` job / cleaned up includes ()
As usual when the base clang version of a distro changes iwyu ends up
broken and needs additional packages and/or options applied to work
again.
2023-11-13 23:24:06 +01:00
Stefan van Kessel d3520943ad
Minor: fix msvc warning "not all control paths return a value" ()
When building with /Od - default cmake debug build for me, the
__assume(false); trick does not work to get rid of the C4714 warnings

https://godbolt.org/z/a6xGnfP7d

D:\tmp\cppcheck\lib\keywords.cpp(205): warning C4715:
'Keywords::getOnly': not all control paths return a value
D:\tmp\cppcheck\lib\keywords.cpp(226): warning C4715:
'Keywords::getOnly': not all control paths return a value
D:\tmp\cppcheck\lib\keywords.cpp(168): warning C4715:
'Keywords::getAll': not all control paths return a value
D:\tmp\cppcheck\lib\keywords.cpp(188): warning C4715:
'Keywords::getAll': not all control paths return a value

Proposed fix: also define NORETURN to [[noreturn]] when according to
__has_cpp_attribute [[noreturn]] is supported
https://en.cppreference.com/w/cpp/feature_test

(For previous discussion see also
https://github.com/danmar/cppcheck/pull/5497)
2023-11-12 17:30:06 +01:00
orbitcowboy b201ef26cb
windows.cfg: Improved configuration of OpenThread() () 2023-11-12 11:37:29 +01:00
chrchr-github a6b7a8c1cc
Fix FP knownPointerToBool with function pointer () 2023-11-12 10:20:18 +01:00
chrchr-github 212d2141d3
Fix FP danglingTempReference with loop over init list () 2023-11-12 10:19:45 +01:00
orbitcowboy f4df28d5ec
windows.cfg: Improved configuration for OpenProcess(). () 2023-11-11 14:08:21 +01:00
chrchr-github 2d232dcaac
Fix varid0 with rvalue reference typedef () 2023-11-11 10:09:08 +01:00
chrchr-github 328daeceb4
Fix debug: varid0 with anonymous union () 2023-11-11 10:01:03 +01:00
Daniel Marjamäki 282c195a6f
Fix (False positive: wrong misra-config variable with accessing object in memory) () 2023-11-09 12:25:42 +01:00
Oliver Stöneberg b0cde34d1a
refs - moved ordering of markup files into shared code / removed related test cases from executor tests ()
This is not completely fixing the issue yet. `test-qml.py` still fails
when using multiple threads.
2023-11-09 10:17:30 +01:00
chrchr-github d24074f7b1
Fix debug: varid0 with reference typedef ()
Why do we even split any declarations in the first place?
2023-11-09 10:11:34 +01:00
Daniel Marjamäki 780b742568
Fix (simplifyTypedef: the "enum" token is not inserted) () 2023-11-09 07:48:33 +01:00
chrchr-github 30bf5cac0a
Partial fix for false negative: functionConst () 2023-11-08 22:37:45 +01:00
Daniel Marjamäki 8f432880fa
Fix (False positive: operator precedence warning even though there are parentheses) () 2023-11-08 18:54:40 +01:00
Daniel Marjamäki 617b7a39cd
Fix (misra.py: crashes when ctu-info line does not have certain attributes) () 2023-11-08 15:23:50 +01:00
chrchr-github 1fa785d81d
Fix FP CastAddressToIntegerAtReturn with std::future () 2023-11-08 13:12:50 +01:00
Oliver Stöneberg f61003d954
scriptcheck.yml: make dmake a separate job and run it on multiple platforms ()
This is essentially an unit test for the `FileLister` so we should make
sure we have proper coverage.
2023-11-08 09:29:40 +01:00
Oliver Stöneberg 2a15428096
fixed - added `--fsigned-char` and `--funsigned-char` command-line options () 2023-11-08 09:28:33 +01:00
chrchr-github cf64ccea22
Fix false negative: passedByValue () 2023-11-07 22:50:31 +01:00
Oliver Stöneberg bc174c502a
fixed - provided order of source files is not preserved () 2023-11-07 21:21:24 +01:00
Daniel Marjamäki 8c63c8ced1
Fix (AST: do not create AST for variable declaration 'bool& var') () 2023-11-07 20:48:56 +01:00
Oliver Stöneberg 87886576fc
TokenList: actually consider configured standard in `isKeyword()` () 2023-11-07 20:39:44 +01:00
chrchr-github d3d70dcc4e
Fix SymbolDatabase: Token::type() is not set properly when inn… ()
…er enum has same name as outer class
2023-11-07 19:57:45 +01:00
Daniel Marjamäki c1aed9681d
Fix (Tokenizer::arraySize: enum constant used as index in array initialization) () 2023-11-07 19:19:19 +01:00
chrchr-github 13e74507dd
Update releasenotes.txt [skip ci] () 2023-11-07 15:11:41 +01:00
chrchr-github d26022ac9a
Fix debug: SymbolDatabase::isFunction found C function 'main' without a return type. () 2023-11-06 21:03:11 +01:00
chrchr-github a57fc9ace6
Partial fix for FN returnReference () 2023-11-06 20:29:13 +01:00
Oliver Stöneberg 704b862a2d
cleaned up the file filtering code and improved testing of it () 2023-11-06 19:06:22 +01:00
chrchr-github de2cfb05b0
Fix FP uninitialized member array, initialized in range for loop () 2023-11-06 16:15:47 +01:00
Daniel Marjamäki fc8c244675
CI: Add selfcheck using Cppcheck Premium. Activates Misra C++ 2008 and Cert C++ 2016 checkers. () 2023-11-06 15:31:47 +01:00
chrchr-github 83ac6bfa0f
Fix crash when calling estimateSize() (f'up to ) () 2023-11-06 15:22:59 +01:00
orbitcowboy 966a89d5f4
Removed -DTIXML_USE_STL flag ()
Updated version of https://github.com/danmar/cppcheck/pull/5145
2023-11-05 15:54:22 +01:00
Daniel Marjamäki 0dc53ac7fe
Fix (Error messages from addons has the wrong file0) () 2023-11-04 17:07:30 +01:00
chrchr-github 72a36172aa
Fix FP uninitStructMember, unreadVariable with pointer to member () 2023-11-04 13:40:06 +01:00
chrchr-github fa7891e37b
Fix FP redundantCopyLocalConst for small type () 2023-11-04 13:38:02 +01:00
chrchr-github 789c032e42
Fix FP passedByValue with anonymous union () 2023-11-04 13:34:08 +01:00
Oliver Stöneberg df860a937d
do not explicitly load `windows.cfg` during command-line parsing ()
As we now fail early on loading of all libraries we no longer need to
explicitly bail out on mandatory ones. This would have also caused
`libraries` and `library` to go out-of-sync and possibly lead to
duplicated loading of the library. It also allows for a
`CppCheckExecutor` to be made private.
2023-11-04 13:33:10 +01:00