chrchr-github
6142ba542a
Fix leakNoVarFunctionCall FP ( #4523 )
2022-09-29 21:58:11 +02:00
chrchr-github
260a757791
Fix #10839 internalAstError with function returning a function ( #4514 )
2022-09-29 21:56:26 +02:00
Oliver Stöneberg
083efe6361
astutils.h: use pre-sized SmallVector in visitAstNodes() ( #3919 )
2022-09-29 21:52:42 +02:00
Oliver Stöneberg
eeb6db05f1
avoid some unnecessary object creations and copies ( #4493 )
2022-09-29 21:47:17 +02:00
Oliver Stöneberg
0481edf9c3
return `SmallVector` from `followAllReferences()` ( #3925 )
2022-09-29 21:41:32 +02:00
chrchr-github
b8b6b41833
Fix #10802 Broken AST lambda inside for loop ( #4520 )
...
* Fix #10802 Broken AST lambda inside for loop
* Add some boost and wxwidget defines (on behalf of "david ingamells")
2022-09-29 13:29:50 +02:00
chrchr-github
56e2af5dec
Fix #9653 FP leakReturnValNotUsed although (void) is specified ( #4431 )
2022-09-27 20:09:04 +02:00
Oliver Stöneberg
d6f1d7bb23
replaced `static const`/fixed `std::vector` containers with `std::array` ( #4440 )
2022-09-27 20:06:15 +02:00
Oliver Stöneberg
10426f6707
cppcheck.cpp: only call `getFileInfo()` if necessary ( #4510 )
2022-09-27 20:04:35 +02:00
Oliver Stöneberg
b9e07e918e
enabled and fixed `readability-named-parameter` clang-tidy warnings ( #4487 )
2022-09-27 20:03:25 +02:00
chrchr-github
cab4997b0b
Fix #11039 Empty AST with delete new / #11327 FP leakReturnValNotUsed with new and offset ( #4513 )
...
* Fix internalAstError with new
* Format
* nullptr check
* Add test for #11039
* Fix #11039 Empty AST with delete new / #11327 FP leakReturnValNotUsed with new and offset
2022-09-27 18:12:58 +02:00
Maksim Derbasov
c8b96c3a20
Typos fix ( #4509 )
2022-09-27 06:48:06 +02:00
chrchr-github
0f79f8bd70
Fix internalAstError with new ( #4508 )
...
* Fix internalAstError with new
* Format
* nullptr check
2022-09-26 22:05:58 +02:00
chrchr-github
64f3f85804
Fix #11332 Function::addArguments found argument 'b' with varid 0 wit… ( #4506 )
...
* Fix #11332 Function::addArguments found argument 'b' with varid 0 with lambda parameter
* Fix varid0 warning
2022-09-26 18:21:21 +02:00
Paul Fultz II
fc39a4d1bb
Fix 11171: False positive: missing return statement when std::enable_if_t is used ( #4504 )
...
* Fix 11171: False positive: missing return statement when std::enable_if_t is used
* Format
* Return false
* Workaround bug in cppcheck
2022-09-26 18:20:42 +02:00
Oliver Stöneberg
657d9143f7
cleaned up includes based on include-what-you-use ( #4502 )
...
* iwyu.yml: include internal check sources
* cleaned up includes based on include-what-you-use
2022-09-25 09:20:34 +02:00
Leila F. Rahman
70c844ddfb
Fix the release function in the ValuePtr class ( #4490 )
2022-09-24 13:25:06 +02:00
chrchr-github
2808fc615e
Fix #10057 "statement without effect" / #4779 FN unusedScopedObject does not work for classes in different namespace ( #4500 )
...
* Partial fix for #10057 unused variable without assignment not detected
* Add test for #9672
* Fix #4779 FN unusedScopedObject does not work for classes in different namespace
* Merge
* Fix #10057 "statement without effect" (unused variable without assignment) not detected
* Format
2022-09-24 12:49:37 +02:00
Oliver Stöneberg
dc03a50414
some small cleanups and refactorings ( #4488 )
...
* moved `plistFile` from `ErrorLogger` to `CppCheck`
* got rid of global CWE objects
* lib/CMakeLists.txt: suppress some `-Wfloat-equal` clang warning in matchcompiled builds as well
* lib/CMakeLists.txt: moved a loop into proper block
* test/CMakeLists.txt: simplified `add_fixture`
* test/CMakeLists.txt: moved `fixture_cost`
* fixed `naming-privateMemberVariable` selfcheck warning
2022-09-24 11:59:13 +02:00
Oliver Stöneberg
e8b9cd64fc
refs #10663 - only match start pattern in `Library::detectContainerInternal()` if necessary ( #4499 )
2022-09-23 20:19:56 +02:00
chrchr-github
d608bec414
Fix FP with std::array ( #4497 )
...
* Fix #1655 wrong usage of std::string in memcpy
* Fix memsetClass FP
* Fix #8619 FN memset on container containing structs with containers
* Token::Match
* Use AST
* simpleMatch
* Fix FP with std::array
* simpleMatch
2022-09-23 20:18:49 +02:00
chrchr-github
0bb82b70d9
Fix #11328 FN functionStatic, functionConst with this ( #4496 )
...
* Fix #11328 FN functionStatic, functionConst with this
* Fix FP
2022-09-23 08:46:31 +02:00
Jim Kuhn
f27fbdd8ab
Fix sense of test (.analyzerinfo files get placed in wrong directory) ( #4486 )
...
* Fix sense of test (.analyzerinfo files get placed in wrong directory)
* Update testanalyzerinformation.cpp
style (tabs -> spaces)
2022-09-21 17:38:23 +02:00
chrchr-github
3b07661fd3
Fix #11293 debug: CheckClass::isMemberVar found used member variable 'x' with varid 0 ( #4489 )
2022-09-21 17:35:10 +02:00
chrchr-github
2aca275e0c
Fix #8619 FN memset on container containing structs with containers ( #4491 )
...
* Fix #1655 wrong usage of std::string in memcpy
* Fix memsetClass FP
* Fix #8619 FN memset on container containing structs with containers
* Token::Match
* Use AST
* simpleMatch
2022-09-21 17:33:48 +02:00
chrchr-github
3644d79162
Fix duplicateConditionalAssign FP ( #4484 )
...
* Fix #9406 FN redundant assignment of Boolean variable
* Fix warning, refactor
* Update testcondition.cpp
* Fix duplicateConditionalAssign FP
* Format
2022-09-20 21:57:27 +02:00
chrchr-github
dcb332acb0
Fix #9406 FN redundant assignment of Boolean variable ( #4482 )
...
* Fix #9406 FN redundant assignment of Boolean variable
* Fix warning, refactor
* Update testcondition.cpp
2022-09-20 07:30:12 +02:00
chrchr-github
f274d499a1
Fix #11171 FP missing return statement when std::enable_if_t is used ( #4480 )
...
* Fix #11171 FP missing return statement when std::enable_if_t is used
* Add check
2022-09-19 12:47:58 +02:00
Daniel Marjamäki
8275f07692
dump: Add Token::isCast attribute
2022-09-18 12:42:58 +02:00
Paul Fultz II
09944c0b7e
Fix 11298: FP danglingTemporaryLifetime when constructing from const char* ( #4479 )
...
* Fix 11298: FP danglingTemporaryLifetime when constructing from const char*
* Format
2022-09-18 08:30:58 +02:00
Paul Fultz II
de7d02293f
Fix 11308: FP accessMoved with virtual function ( #4478 )
...
* Fix 11308: FP accessMoved with virtual function
* Format
2022-09-18 08:30:06 +02:00
Paul Fultz II
d34de745c0
Fix 11306: FP knownConditionTrueFalse with strlen() ( #4477 )
...
* Fix 11306: FP knownConditionTrueFalse with strlen()
* Add another test
2022-09-18 08:29:10 +02:00
chrchr-github
cb6f04a16c
Fix #11315 FP zerodivcond from enum definition / #11310 FP unassignedVariable with static variable ( #4476 )
...
* Fix #11315 FP zerodivcond from enum definition
* Simplify Boolean expression
* Fix #11310 FP unassignedVariable with static variable
2022-09-17 18:50:07 +02:00
Sergei Trofimovich
3b840e7ff1
lib/sourcelocation.h: add missing <cstdint> include ( #4474 )
...
Without the change build on upcoming gcc-13 fails as:
In file included from lib/symboldatabase.h:28,
from lib/astutils.h:36,
from test/testastutils.cpp:20:
lib/sourcelocation.h:52:10: error: 'uint_least32_t' in namespace 'std' does not name a type
52 | std::uint_least32_t m_line = 0;
| ^~~~~~~~~~~~~~
2022-09-16 21:36:37 +02:00
Oliver Stöneberg
897826006e
mitigated some clang-tidy warnings in headers ( #4472 )
...
* erroritem.h: avoid `performance-no-int-to-ptr` clang-tidy warning
* suppress `readability-inconsistent-declaration-parameter-name` clang-tidy warnings for Qt signals
* tokenlist.h: mitigated `readability-make-member-function-const` clang-tidy warnings
* fixed `modernize-use-override` clang-tidy warnings in headers
* fixed `modernize-pass-by-value` clang-tidy warnings in headers
* tokenize.cpp: avoid unnecessary copy
2022-09-16 18:59:15 +02:00
Oliver Stöneberg
339484d2a1
mitigated and enabled more clang-tidy warnings ( #4470 )
...
* fixed some `performance-inefficient-string-concatenation` clang-tidy warnings
* fixed and enabled `modernize-replace-random-shuffle` clang-tidy warning
* fixed and enabled `bugprone-suspicious-string-compare` clang-tidy warning
* mitigated and enabled `readability-non-const-parameter` clang-tidy warnings
* clang-tidy.md: documented some disabled checks
* mitigated and enabled `performance-unnecessary-value-param` clang-tidy warnings
2022-09-16 18:58:59 +02:00
chrchr-github
45ccc9ba1e
Fix ctunullpointer FP ( #4471 )
2022-09-16 12:11:34 +02:00
Oliver Stöneberg
b3ec225480
iwyu.yml: use `debian:unstable` to always get latest include-what-you-use / cleaned up includes ( #4466 )
...
* iwyu.yml: use debian:unstable to always get latest include-what-you-use
* cleaned up includes based on include-what-you-use
* mitigated include-what-you-use false positives
2022-09-16 07:15:49 +02:00
chrchr-github
c9ade33298
Fix memsetClass FP ( #4465 )
2022-09-15 20:20:49 +02:00
Daniel Marjamäki
f1aa9eb48f
dump: add externLang attribute for tokens
2022-09-15 19:57:42 +02:00
chrchr-github
d1386a842a
Fix #11301 debug: constStatementError not handled. ( #4463 )
...
* Fix #11301 debug: constStatementError not handled.
* Use function
2022-09-14 23:57:02 +02:00
chrchr-github
266174ddc4
Fix #10993 danglingTemporaryLifetime reported in two different locati… ( #4462 )
...
* Fix #10993 danglingTemporaryLifetime reported in two different locations for std::string_view usage
* Missing include
* Add test
2022-09-14 07:28:04 +02:00
chrchr-github
07caf17eb3
Fix #1655 wrong usage of std::string in memcpy ( #4460 )
2022-09-13 15:14:25 +02:00
chrchr-github
e904f7341e
Fix ValueFlow crash ( #4461 )
2022-09-13 12:25:15 +02:00
Paul Fultz II
43caa32abf
Fix 9755: false negative: access of moved variable in conditional code ( #4459 )
...
* Fix 9755: false negative: access of moved variable in conditional code
* Format
2022-09-11 12:32:01 +02:00
Oliver Stöneberg
76d1b9f31a
avoid unnecessary copies with `emplace_back()` ( #4450 )
...
* avoid unnecessary copies with `emplace_back()`
* cmdlineparser.cpp: suppress `accessMoved` selfcheck false positives
2022-09-10 11:25:15 +02:00
Paul Fultz II
53820515c9
Set valueflow for container elements ( #4455 )
...
* Track elements to containers
* Format
* Handle other access methods
* Format
2022-09-10 09:26:44 +02:00
Oliver Stöneberg
433293b9ab
added missing version bumps to 2.10 ( #4420 )
2022-09-09 21:02:04 +02:00
Paul Fultz II
117a753b10
Partial fix 11154: FN: knownConditionTrueFalse ( #4453 )
...
* Partial fix 11154: FN: knownConditionTrueFalse
* Formay
* Add more tests
* FOrmat
* Fix FP
* Add test
* Check for side effects
* Format
* Update tests
* Format
2022-09-08 22:08:38 +02:00
Oliver Stöneberg
dbc05da356
fixed some clang-tidy warnings ( #4435 )
2022-09-08 20:01:41 +02:00
Paul Fultz II
7c986fbef1
Fix 11203: false positive: knownConditionTrueFalse 'always false' when comparing integer with floating-point ( #4350 )
2022-09-08 19:59:02 +02:00
Paul Fultz II
f83b8dd385
Fix 11194: FN: knownConditionTrueFalse ( #4452 )
...
* Fix 11194: FN: knownConditionTrueFalse
* Format
2022-09-08 18:51:44 +02:00
Daniel Marjamäki
92845295b8
Fix broken CI caused by my qt fix
2022-09-08 11:12:38 +02:00
Oliver Stöneberg
d46ea7ba86
avoid unnecessary copies with `push_back()` and `push_front()` ( #4451 )
2022-09-08 09:21:35 +02:00
Daniel Marjamäki
2e8d855b35
Tokenizer: Skip qt simplification if qt library is not loaded
2022-09-08 07:47:58 +02:00
Daniel Marjamäki
b99474fe13
Tokenizer: Remove redundant setVarId call
2022-09-08 07:46:19 +02:00
Oliver Stöneberg
847391ea2d
some minor optimizations ( #4449 )
...
* cppcheck.cpp: reduced scope of a variable
* cppcheck.cpp: removed unnecessary severity checks
* cppcheck.cpp: avoid unnecessary copy
* templatesimplifier.cpp: perform early exit in loop in `expandTemplate()`
2022-09-07 19:19:04 +02:00
Paul Fultz II
32d96104d6
Fix 6370: ValueFlow: array element with known value ( #4447 )
...
* Fix 6370: ValueFlow: array element with known value
* Format
* Move comment
2022-09-07 19:16:07 +02:00
Paul Fultz II
6543b429c5
Fix 11285: FN: zerodiv ( #4448 )
...
* Fix 11285: FN: zerodiv
* Format
2022-09-07 19:15:37 +02:00
chrchr-github
6960332f8a
Fix #11294 FP arrayIndexOutOfBoundsCond with extra parentheses ( #4442 )
2022-09-06 21:21:06 +02:00
Oliver Stöneberg
b3762cd76a
actually perform system tinyxml2 build on macos / fixed system tinyxml2 include ( #4445 )
...
* lib/CMakeLists.txt: removed unnecessary external include
* look up tinyxml2 include dir when using system one and specify it
* lib/CMakeLists.txt: do not treat bundled headers as system ones
* CI-unixish.yml: actually perform system tinyxml2 build on macos
2022-09-06 18:30:59 +02:00
Paul Fultz II
2d37a77281
Fix 11296: FN: knownConditionTrueFalse ( a !=0 && b != 0 && a == 0) ( #4444 )
2022-09-06 07:31:48 +02:00
Paul Fultz II
016793f258
Fix 11295: Regression FP: knownConditionTrueFalse ( #4443 )
2022-09-06 07:31:38 +02:00
Oliver Stöneberg
436b8bd3f1
optimized `isSameConstantValue()` a bit ( #4441 )
2022-09-05 21:36:26 +02:00
chrchr-github
31118fdce5
Fix noreturn FP with while() ( #4429 )
...
* Fix checkLibraryFunction FPs
* Fix FP with fclose()
* Format
* Fix FP with reinterpret_cast
* Fix noreturn FP with while()
2022-09-04 10:26:31 +02:00
Paul Fultz II
6ce5c24f21
Refactor knownConditionTrueFalse check and isUsedAsBool function ( #4432 )
...
* Refactor knownConditionTrueFalse check and isUsedAsBool function
* Format1
* Format
* Skip assign
2022-09-04 10:24:45 +02:00
Maksim Derbasov
f93b588603
New check: use memcpy/memset instead of loop ( #4257 )
2022-09-03 23:29:06 +02:00
Daniel Marjamäki
9306c6f329
dump: Add Function::isAttributeNoreturn info
2022-09-03 12:09:20 +02:00
chrchr-github
cf52ee098a
Fix checkLibraryFunction FPs ( #4423 )
...
* Fix checkLibraryFunction FPs
* Fix FP with fclose()
* Format
* Fix FP with reinterpret_cast
2022-09-02 07:51:10 +02:00
chrchr-github
79daad8ff4
Fix #11020 FP arrayIndexOutOfBounds if string literals are assigned conditionally ( #4428 )
2022-09-01 22:59:46 +02:00
Daniel Marjamäki
4779f0e172
TemplateSimplifier: Fixed instantiation when template parameters are A<..>, B<..>
2022-09-01 20:24:01 +02:00
chrchr-github
5804cc44e7
Fix FP bufferAccessOutOfBounds ( #4427 )
...
* Fix FN with buffer size 1
* Fix FP bufferAccessOutOfBounds
2022-08-31 19:31:37 +02:00
chrchr-github
3925a27182
Fix FP knowConditionTrueFalse ( #4419 )
...
* Fix #10426 FN (style) Condition 's.empty()' is always false
* Fix test
* Fix FP knowConditionTrueFalse
* Check for casts
* Fix FP for user-defined functions
* Adjust condition detection
* Tweaks
2022-08-30 18:08:24 +02:00
chrchr-github
9ab4f9976d
Fix #10426 FN (style) Condition 's.empty()' is always false ( #4414 )
...
* Fix #10426 FN (style) Condition 's.empty()' is always false
* Fix test
2022-08-29 12:25:10 +02:00
chrchr-github
1e14e360cb
Fix #8295 FN (error) Buffer is accessed out of bounds (wcpncpy, wcsncpy) ( #4412 )
...
* Fix #8295 FN (error) Buffer is accessed out of bounds (wcpncpy, wcsncpy)
* Fix cfg, validation
* Fix validation
2022-08-29 12:24:58 +02:00
chrchr-github
df704361f6
Fix FN with buffer size 1 ( #4410 )
2022-08-29 12:24:44 +02:00
Daniel Marjamäki
a400c94230
Update Copyrights
2022-08-28 14:22:12 +02:00
Daniel Marjamäki
5e0fc24bb7
Fixed #11232 (Syntax Error: AST broken, binary operator '!=' doesn't have two operands)
2022-08-27 18:02:19 +02:00
chrchr-github
7156afe003
Fix #5140 FN (error) buffer access out of bounds - known argument ( #4402 )
...
* Fix #5140 FN (error) buffer access out of bounds - known argument const char* argv[]
* Format
2022-08-26 17:27:54 +02:00
chrchr-github
917496a844
Fix #5678 FN destructor with no definition hide mismatching alloc/dealloc ( #4401 )
...
* Fix #5678 FN destructor with no definition hide mismatching allocation / deallocation
* Format
* Fix test
* Format
2022-08-25 22:52:51 +02:00
chrchr-github
456c6b410e
Fix #2304 FN known strcpy parameter ( #4396 )
...
* Fix #2304 FN known strcpy parameter
* Parentheses
* Format
2022-08-24 21:23:45 +02:00
Oliver Stöneberg
467648bec6
fixed #11249 (potential hang with -j and --showtime= when using threads) - synchronized access to `TimerResults::mResults` / added TSAN to CI ( #4355 )
2022-08-23 20:30:45 +02:00
chrchr-github
13e8d5220c
Fix another c_strParam regression ( #4394 )
2022-08-23 20:26:36 +02:00
Daniel Marjamäki
a2454ecbca
cli import cppcheck project with premium options
2022-08-23 20:13:03 +02:00
chrchr-github
4be7f689d7
Fix c_strParam regression ( #4393 )
...
* Fix #7515 New check: Not needed c_str() operation
* Comment
* Detect more instances of c_str() misuse
* Fix bad merge
* Check for data() also
* Fix
* Format
* Format
* Fix c_strParam regression
2022-08-23 15:00:27 +02:00
Daniel Marjamäki
5d267000e2
GUI: configuration of premium features
2022-08-22 21:11:28 +02:00
chrchr-github
66fca7ba91
Detect more instances of c_str() misuse ( #4392 )
...
* Fix #7515 New check: Not needed c_str() operation
* Comment
* Detect more instances of c_str() misuse
* Fix bad merge
* Check for data() also
* Fix
* Format
* Format
2022-08-22 14:06:10 +02:00
Oliver Stöneberg
9b4973d711
astutils.cpp: some small optimizations ( #4378 )
2022-08-21 17:39:21 +02:00
Daniel Marjamäki
c820d2ba97
refactoring
2022-08-21 17:33:43 +02:00
PKEuS
d81a758850
LCppC backports: Refactorizations/Optimizations ( #4204 )
2022-08-21 17:21:02 +02:00
Oliver Stöneberg
0e1cd8b2ac
do not do C++ processing for C code in `parsedecl()` ( #4304 )
2022-08-21 17:11:22 +02:00
Oliver Stöneberg
670b872f30
implemented move constructor for `TemplateSimplifier::TokenAndName` ( #4390 )
2022-08-21 17:02:03 +02:00
chrchr-github
d351a97a0f
Fix #8336 FN stlcstrParam ( #4389 )
...
* Fix #7515 New check: Not needed c_str() operation
* Comment
* Fix error messages
* Handle more complex string expressions
* Fix #8336 FN stlcstrParam
* Handle iterators
* Format
* Format
* Parentheses
2022-08-21 13:04:43 +02:00
Oliver Stöneberg
1202efb438
some `--exception-handling` related improvements ( #4368 )
2022-08-20 20:54:31 +02:00
chrchr-github
b04bf7396f
Fix #7515 New check: Not needed c_str() operation ( #4371 )
2022-08-20 20:52:10 +02:00
Oliver Stöneberg
d73a33d17e
avoid redundant `Token::declEndToken()` calls ( #4363 )
2022-08-20 20:50:14 +02:00
Oliver Stöneberg
2afd5f80e7
smallvector.h: bake `reserve()` into the non-boost `SmallVector` implementation ( #4385 )
2022-08-20 20:44:26 +02:00
Oliver Stöneberg
1d95d1908d
refs #10663 - sped up `Library::detectContainerOrIterator()` by iterating the containers only once ( #4380 )
2022-08-20 12:14:55 +02:00
chrchr-github
2ab8de2650
Fix #11145 FP negativeMemoryAllocationSize with possible value ( #4387 )
2022-08-20 07:56:31 +02:00
Oliver Stöneberg
f138df2909
mathlib.h: replaced slow `std::ostringstream` with `std::to_string()` in `MathLib::toString()` ( #4382 )
2022-08-19 20:44:24 +02:00
chrchr-github
80a486dda0
Fix #11167 FP virtual call in destructor even though class is final / Delete 'final' from specializations ( #4383 )
...
* Add 'final' keyword
* Delete 'final' from specializations
* Fix #11167 FP virtual call in destructor even though class is final
* Fix test
2022-08-19 18:26:00 +02:00
Oliver Stöneberg
16f598c409
added missing `sstream` includes ( #4381 )
2022-08-19 10:16:23 +02:00
chrchr-github
1aa259569e
Fix #10138 syntax error : int (operator"" _ii)(unsigned long long v) … ( #4374 )
...
* Fix #10138 syntax error : int (operator"" _ii)(unsigned long long v) { return v; }
* Format
2022-08-18 23:38:45 +02:00
Oliver Stöneberg
e09f5f0db7
refs # 11106 (optimize CheckUnusedVar::checkStructMemberUsage()) - added missing loop breaks ( #4376 )
2022-08-18 23:36:21 +02:00
chrchr-github
6a0c254d1f
Fix #9931 FP zerodiv (daca@home) ( #4379 )
...
* Fix #9931 FP zerodiv (daca@home)
* Format
* Parentheses
* clang-tidy
2022-08-18 20:38:36 +02:00
chrchr-github
4a64e20592
unusedScopedObject: Don't warn for void statements ( #4370 )
...
* Fix unusedScopedObject FPs
* Simplify
* Simplify
* Fix test
* Don't warn for void statements
* Format
2022-08-17 19:45:46 +02:00
Oliver Stöneberg
0f0c4061ff
astutils.cpp: avoid redundant callback invocation in `isExpressionChangedAt()` ( #4369 )
2022-08-17 13:50:39 +02:00
Oliver Stöneberg
5f171b9673
fixed some `modernize-use-emplace` false negatives with `std::stack` / removed `internalStlUsage` check ( #4346 )
2022-08-17 09:50:14 +02:00
chrchr-github
5b4c6c1e73
Fix #11026 FP pointerOutOfBounds with strlen() ( #4366 )
2022-08-17 09:45:07 +02:00
chrchr-github
1a95515e47
Fix unusedScopedObject FPs ( #4364 )
2022-08-17 09:11:23 +02:00
Oliver Stöneberg
98b9f2cbf1
reduced scope of some variables and avoided some copies ( #4328 )
2022-08-16 22:28:39 +02:00
chrchr-github
3dc2c0bd42
Fix #11257 FN constStatement with misused comma ( #4365 )
2022-08-16 22:10:58 +02:00
Oliver Stöneberg
31d704e4bc
cppcheckexecutor.cpp: extracted platform-dependent code into separate files ( #4359 )
2022-08-16 22:03:44 +02:00
Paul Fultz II
72c764b034
Expose exprId to addon ( #4354 )
2022-08-16 22:00:31 +02:00
Oliver Stöneberg
38c7d0a5f8
config.h: implemented `NORETURN` for GCC < 5 ( #4361 )
2022-08-16 06:52:54 +02:00
Oliver Stöneberg
4bf5dcd29f
cleaned up includes based on include-what-you-use ( #4358 )
...
* cleaned up includes based on include-what-you-use
* testlibrary.cpp: no need for `empyString` optimization
2022-08-14 12:44:19 +02:00
Oliver Stöneberg
f7caf7dc93
avoid some unnecessary `std::string()` construction in comparisons ( #4357 )
...
* avoid unnecessary string wrapping
* consistently use `strcmp()`
2022-08-14 12:44:09 +02:00
chrchr-github
afef71f6b6
Partial fix for #10057 unused variable without assignment not detected ( #4348 )
...
* Partial fix for #10057 unused variable without assignment not detected
* Add test for #9672
2022-08-13 08:29:06 +02:00
Oliver Stöneberg
c54b3f4de0
removed leftover bughunting GUI related fields from `ErrorMessage` ( #4351 )
2022-08-13 08:27:52 +02:00
Paul Fultz II
bfd9470600
Fix 11158: FP zerodiv in loop ( #4356 )
...
* Fix 11158: FP zerodiv in loop
* Format
* Add another test
* Format
* Fix FP
* Format
2022-08-13 08:27:20 +02:00
chrchr-github
bdbd84ba98
#11238 : Fix regression ( #4349 )
...
* Fix #11238 FP knownConditionTrueFalse with constexpr?
* Modify isConstVarExpression()
* Use predicate
* Format
* #11238 : Fix regression
2022-08-09 13:13:16 +02:00
chrchr-github
974e34490f
Fix #9282 FP Unused private function ( #4327 )
2022-08-07 20:06:32 +02:00
Oliver Stöneberg
156323c95e
avoid unnecessary copies with `insert()` ( #4323 )
2022-08-07 19:31:16 +02:00
chrchr-github
078a6d7804
Fix #11238 FP knownConditionTrueFalse with constexpr? ( #4341 )
2022-08-07 19:06:19 +02:00
chrchr-github
d5a0dfda00
Fix #11239 checkLibraryCheckType with asm goto() (invalid varid), add test for #8666 ( #4340 )
...
* Add test for #6541 , avoid duplicate warning
* Add test for #5475
* Fix test
* Merge
* Add test for #8666
* Fix #11239 checkLibraryCheckType with asm goto() (invalid varid)
* Format
2022-08-04 21:35:18 +02:00
umanamente
460f63558d
Fixed typo in checkautovariables.cpp: getPointerDepth() ( #4329 )
2022-08-04 07:52:10 +02:00
Paul Fultz II
c0f55a2b85
Fix 11142: FP nullPointer before assignment ( #4319 )
...
* Fix 11142: FP nullPointer before assignment
* Format
* Use simpleMatch
2022-08-03 19:05:07 +02:00
Paul Fultz II
6cb3a79a64
Fix 11147: FP invalidContainer with substr() ( #4333 )
...
* Fix 11147: FP invalidContainer with substr()
* Format
2022-08-03 19:04:44 +02:00
chrchr-github
dd927aab9b
Fix #11237 checkLibraryNoReturn with unassigned object ( #4338 )
...
* Handle float values
* Fix #11237 checkLibraryNoReturn with unassigned object
2022-08-03 19:04:10 +02:00
chrchr-github
a62c3ea90e
Fix #11234 Broken AST with auto**, FP constStatement ( #4339 )
2022-08-03 19:03:38 +02:00
chrchr-github
0eabe0505b
Handle float values ( #4336 )
2022-08-02 22:11:31 +02:00
chrchr-github
71f9a7269f
Add test for #6541 , #5475 , avoid duplicate warning ( #4335 )
...
* Add test for #6541 , avoid duplicate warning
* Add test for #5475
* Fix test
2022-08-02 21:43:18 +02:00
chrchr-github
bc409776e3
Fix #10320 Wrong redundant condition: misleading/wrong message ( #4334 )
...
* Fix #10320 Wrong redundant condition: misleading/wrong message
* Use expressionString()
* Clarify condition
* Update testcondition.cpp
* Trigger CI
2022-08-02 18:31:02 +02:00
chrchr-github
92d569afb6
#11233 FP: knownConditionTrueFalse (wrong message text) ( #4330 )
...
* #11233 FP: knownConditionTrueFalse (wrong message text)
* Format
* Update testcondition.cpp
* Trigger CI
2022-08-02 18:18:46 +02:00
chrchr-github
38fdbe0890
Fix #9716 Syntax error for function-try-block in global scope ( #4305 )
...
* Fix #9716 Syntax error for function-try-block in global scope
* static through instance
* Handle multiple catch blocks
* Add test
* Fix skip logic
* Handle init lists in simplifyFunctionTryCatch()
2022-07-31 14:49:50 +02:00
Oliver Stöneberg
efaaa58896
fixed some `modernize-use-emplace` false negatives and some `bugprone-assignment-in-if-condition` warnings ( #4311 )
2022-07-28 22:53:59 +02:00
Oliver Stöneberg
b65b47d3a8
enabled and fixed `modernize-pass-by-value` clang-tidy warnings ( #4169 )
2022-07-28 22:51:45 +02:00
chrchr-github
304e448749
Fix #8476 --check-library reports missing configuration for static_assert ( #4314 )
2022-07-28 22:47:15 +02:00
chrchr-github
c340b6ae6c
Fix #11191 FP moduloofone with pow() ( #4312 )
2022-07-28 22:11:23 +02:00
Daniel Marjamäki
898ad314ab
badBitmaskCheck: Avoid FP when there is #ifdef in expression
2022-07-28 21:56:05 +02:00
Oliver Stöneberg
d6eb3a8f40
some changes for clang/clang-tidy 15 ( #4310 )
2022-07-26 15:30:53 +02:00
Oliver Stöneberg
887463855b
mitigated most clang-tidy warnings in headers ( #4175 )
2022-07-26 11:10:03 +02:00
chrchr-github
58d7185d64
Fix #10077 FP functionConst when overloaded operator ++ is used ( #4309 )
2022-07-26 08:30:59 +02:00
Oliver Stöneberg
0005be1dbf
some cleanups ( #4308 )
2022-07-26 08:28:55 +02:00
chrchr-github
15f8c71ec3
Fix #9946 FP: unassignedVariable when operator() is called subsequently ( #4303 )
2022-07-24 17:52:14 +02:00
chrchr-github
479533a80a
Rework fix for #11008 ( #4296 )
2022-07-24 12:15:04 +02:00
chrchr-github
1aceded300
Fix #10977 FP noExplicitConstructor with variadic template ( #4301 )
2022-07-24 10:18:19 +02:00
Oliver Stöneberg
b2f15fdbb1
reduced padding in some classes/structs ( #4295 )
2022-07-24 10:17:11 +02:00
Daniel Marjamäki
894975f845
SymbolDatabase: Add Function::access info for methods
2022-07-22 10:37:00 +02:00
chrchr-github
0d72216cca
Fix BufferOverrun TODO ( #4300 )
...
* Fix BufferOverrun TODO
* clang-tidy
2022-07-22 07:24:34 +02:00
chrchr-github
79f091c59a
Fix uselessCallsConstructor TODOs ( #4299 )
...
* Fix uselessCallsConstructor TODOs
* Format
2022-07-21 22:15:16 +02:00
Daniel Marjamäki
a7afaba21d
SymbolDatabase: add BaseInfo::nameTok to dumpfile
2022-07-21 15:57:41 +02:00
chrchr-github
5342e2cd03
Fix #11037 FP knownConditionTrueFalse with dynamic_cast ( #4297 )
2022-07-20 20:48:17 +02:00
Oliver Stöneberg
4316884123
valueflow.cpp: avoid some copies related to `ErrorPath` ( #4160 )
2022-07-20 10:57:49 +02:00
Daniel Marjamäki
ebe8dc2cf3
SymbolDatabase: Extended dumpfiles. Scope: derivedFrom types. Function: overridden function.
2022-07-20 07:24:27 +02:00
chrchr-github
457a0cff87
Fix #11016 FP unusedStructMember when used through iterator (regression) ( #4289 )
...
* Format
* Fix #11016 FP unusedStructMember when used through iterator (regression)
* Format
* Fix test
* Format
* Nullptr check
2022-07-19 20:42:54 +02:00
Oliver Stöneberg
f644938eb0
fixed Cppcheck version ( #4292 )
2022-07-19 20:42:19 +02:00
chrchr-github
5e537a666f
Fix --check-library warning for int(i) ( #4293 )
2022-07-19 20:41:18 +02:00
chrchr-github
c736fe8787
Fix #11008 FP doubleFree with pointer in struct ( #4294 )
2022-07-19 20:41:08 +02:00
Daniel Marjamäki
db155a59c1
Tokenizer: remove simplifyTokenList2
2022-07-18 16:20:36 +02:00
chrchr-github
b08aabefee
Fix #9877 FP unreadVariable (incomplete code; missing macro definition) ( #4278 )
2022-07-17 19:40:39 +02:00
chrchr-github
4894cdab8f
Fix #11108 FP unreadVariable with unique_ptr and unknown c'tor ( #4284 )
...
* Fix #11108 FP unreadVariable with unique_ptr and unknown c'tor
* Fix test
2022-07-16 23:46:55 +02:00
chrchr-github
b16d12b5fb
Improve check for wchar_t ( #4285 )
2022-07-16 23:46:10 +02:00
chrchr-github
109a031ec7
Fix #11195 Add redundantContinue check ( #4283 )
2022-07-16 16:02:58 +02:00
chrchr-github
9e74da6126
Fix #11098 FP compare with negated constant ( #4282 )
2022-07-16 07:28:15 +02:00
chrchr-github
53cd3dc665
Fix #10661 FP extern function reported as unused ( #4279 )
2022-07-14 20:59:58 +02:00
chrchr-github
2543dc97d2
Fix FP bitwiseOnBoolean ( #4280 )
2022-07-14 20:59:39 +02:00
chrchr-github
2c7d98626a
Fix FP leakNoVarFunctionCall with Qt object ( #4272 )
...
* Add missing <leak-ignore/>, test
* Fix qt.cfg, format
* Fix FP leakNoVarFunctionCall
* Format
* Delete memory, rule of five
* Missing include
* Avoid dependency
* explicit
* Fix Qt test case
* Fix typo
* Fix
* Add Q_OBJECT
2022-07-13 21:09:53 +02:00
chrchr-github
6eab3cb8bd
Fix #9788 ctu: false negative array index out of bounds for array arguments ( #4277 )
2022-07-13 21:08:51 +02:00
chrchr-github
49117f5aeb
Fix #7375 static_assert shouldn't be reported by --check-library ( #4276 )
...
* No need to check smart pointers, since they take template arguments
* Fix #7375 static_assert shouldn't be reported by --check-library
2022-07-13 21:08:43 +02:00
chrchr-github
21d992cc00
Fix crash on Windows with -j option ( #4229 )
...
* Fix crash on Windows with -j option
* Disable CI-cygwin workflow
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Try to fix Cygwin build
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Update CI-cygwin.yml
* Cygwin uses THREADING_MODEL_FORK
* Restore workflows
* Remove comment
* Fix dmake
* Fix #11179 FP invalidFunctionArgStr
* Revert "Fix #11179 FP invalidFunctionArgStr"
This reverts commit dd5d3e67c6
.
2022-07-13 13:46:03 +02:00
Daniel Marjamäki
b387ae80f1
Fixed whole program analysis
2022-07-12 22:58:52 +02:00
PKEuS
f3565e1056
Improvement: Support member variables in CheckOther::checkIncompleteArrayFill() ( #4205 )
...
Merged from LCppC.
2022-07-12 19:43:48 +02:00
chrchr-github
381c38b2f5
Improve check: uselessCallsConstructor ( #4270 )
2022-07-12 17:40:14 +02:00
Oliver Stöneberg
22be5f29aa
fixed #11183 (checkLibraryFunction with parameter to "std::string()") / added rudimentary tests for `CheckFunctions::checkLibraryMatchFunctions()` / added test for #10105 ( #4265 )
2022-07-12 17:39:01 +02:00
Daniel Marjamäki
a93c2c5263
cppcheck: keep ctu-info files if there is a cppcheck build dir
2022-07-12 10:14:37 +02:00
chrchr-github
47c2a01392
Fix #11166 inefficient way to remove last character from std::string ( #4267 )
...
* Fix #11166 inefficient way to remove last character from std::string
* Format
* Modify message, add test
* Format
* Fix another warning
2022-07-11 23:07:37 +02:00
chrchr-github
c5dcd49dae
Fix #4233 FN: Bitwise operation with bool and int ( #4266 )
...
* Fix #4233 FN: Bitwise operation with bool and int
* Format
2022-07-11 22:58:37 +02:00
chrchr-github
8fc75402a1
Fix #11179 FP invalidFunctionArgStr ( #4264 )
2022-07-11 22:58:19 +02:00
chrchr-github
f9337b725b
Fix nullptr deref ( #4262 )
...
* Fix some FNs related to c_str()
* Format, fix FP
* Fix nullptr deref
* Fix merge
2022-07-11 22:58:08 +02:00
Oliver Stöneberg
e8b0f12367
replaced `if(MATCHES)` with `if(STREQUAL)` ( #4263 )
...
`MATCHES` does regular expression matching which is not the intended behavior here. `Clang` still requires it since it also needs to match `AppleClang.
2022-07-11 10:46:18 +02:00
Armin Müller
0ae9877766
Typos found by running "codespell" ( #4260 )
2022-07-10 22:40:05 +02:00
chrchr-github
c218859418
Fix some FNs related to c_str() ( #4258 )
2022-07-10 11:38:01 +02:00
chrchr-github
f5c4a21eae
Fix #10704 FN redundantCopyLocalConst ( #4115 )
2022-07-10 11:33:24 +02:00
Oliver Stöneberg
c9c1f83a69
use `emptyString` more consistently ( #4034 )
2022-07-10 10:57:29 +02:00
Oliver Stöneberg
c36320747f
some `missingInclude`/`missingIncludeSystem` fixes and tests ( #4027 )
...
* do not emit `missingInclude` and `missingIncludeSystem` errors when not enabled / fixed and improved TestPreprocessor::inline_suppression_for_missing_include()
* testpreprocessor.cpp: added missing tests for `missingInclude` and `missingIncludeSystem`
* cppcheckexecutor.cpp: `missingIncludeSystem` was not emitted in normal analysis if `missingInclude` existed
* dmake
* added `run-dmake` as `testrunner` dependency
2022-07-09 23:21:11 +02:00
orbitcowboy
c117f62926
Fixed zerodiv/moduloofone FNs for more math functions
2022-07-09 22:36:17 +02:00
orbitcowboy
8215521843
Fixed zerodiv/moduloofone FNs for more math functions
2022-07-09 19:59:16 +02:00
orbitcowboy
ef47d34e75
Fixed zerodiv/moduloofone FNs for more math functions
2022-07-09 19:21:58 +02:00
orbitcowboy
0282c3a86e
Fixed zerodiv/moduloofone FN for '1/std::expm1(0)'
2022-07-09 17:52:58 +02:00
orbitcowboy
07eeee1620
Fixed zerodiv FN for '1/std::exp2(0)'
2022-07-09 17:47:21 +02:00
orbitcowboy
048d31ec56
Fixed zerodiv FN for '1/std::erfc(42)'
2022-07-09 17:43:17 +02:00
orbitcowboy
87c1e6587a
Fixed zerodiv FN for '1/std::erf(0)'
2022-07-09 17:38:28 +02:00
orbitcowboy
c777cd5060
Fixed zerodiv FN for '1/std::ceil(0)'
2022-07-09 17:32:32 +02:00
orbitcowboy
41b6452604
Fixed zerodiv FN for '1/std::cbrt(0)' and added more test cases for other math functions
2022-07-09 17:28:15 +02:00
Paul Fultz II
6b72274c67
Evaluate math library functions in valueflow ( #4255 )
...
* Evaluate math library functions in valueflow
* Format
2022-07-09 07:40:32 +02:00
Paul Fultz II
edebe746bc
Fix 10361: false negative: uninitvar (std::next(iterator)) ( #4256 )
2022-07-09 07:39:04 +02:00
Jens Yllman
b246781da6
Try to stop range overflow in forwardRange() ( #4235 )
...
* Try to stop range overflow in forwardRange()
* Use predefinded function for check instead
2022-07-09 00:57:44 +02:00
Paul Fultz II
0b63e7273d
Fix 11162: FP: knownConditionTrueFalse ( #4254 )
...
* Fix 11162: FP: knownConditionTrueFalse
* Format
2022-07-09 00:57:25 +02:00
Oliver Stöneberg
b51aea5531
separated process execution code into `ProcessExecutor` ( #4249 )
2022-07-08 16:42:57 +02:00
Tau
c17e2b9826
Correctly interpret boolean literals in `execute()` ( #4251 )
...
* Correctly interpret boolean literals in `execute()`
* Add regeression test case for boolean literals
2022-07-08 12:39:29 +02:00
chrchr-github
bd92e7411c
Fix #11163 Hang on smart pointer with auto type deduction ( #4250 )
...
* Fix #11163 Hang on smart pointer with auto type deduction
* Format
* Format
2022-07-08 12:37:53 +02:00
chrchr-github
89a9e5ecc6
Fix #9944 FP: terminateStrncpy doesn't account for size check ( #4252 )
...
* Fix #9944 FP: terminateStrncpy doesn't account for size check
* Fix container size check
* Undo
* Format
* Rebuild
* Rebuild
2022-07-08 12:35:21 +02:00
Daniel Marjamäki
a71a647c39
Fix syntax error
2022-07-07 19:45:47 +02:00
Daniel Marjamäki
e1d3e6f72e
Catch internal error during whole program analysis
2022-07-07 19:14:18 +02:00
Daniel Marjamäki
d1812c8022
Cppcheck: Write product name if provided in xml output
2022-07-07 17:35:13 +02:00
Daniel Marjamäki
68bb724dcc
ErrorLogger: do not allocate huge std::string when column is -1
2022-07-07 15:07:17 +02:00
Daniel Marjamäki
b888f9cf92
use hash instead of checksum to check if content is changed
2022-07-07 12:16:01 +02:00
Daniel Marjamäki
29402b4d1a
Fix Coverity CID1490221 warning. settings is dereferenced and then checked.
2022-07-05 07:46:39 +02:00
Daniel Marjamäki
d8239b26f1
Tokenizer: Remove simplifyCalculations from simplifyTokenList2
2022-07-04 22:54:43 +02:00
chrchr-github
22aeeb1788
Fix ClangImport crash on Windows paths ( #4246 )
...
* Fix crash on Windows paths
* Fix test
* Enable fix
* Cut trailing ':'
2022-07-02 17:43:52 +02:00
chrchr-github
596f75e2af
Fix FP compareValueOutOfTypeRangeError ( #4245 )
...
* Fix FP compareValueOutOfTypeRangeError
* Remove suppressions
2022-07-01 10:48:32 +02:00
chrchr-github
27578e9c4c
Fix FP returnStdMoveLocal ( #4244 )
2022-06-30 13:50:31 +02:00
chrchr-github
d8e64b4cbb
Fix FP leakNoVarFunctionCall ( #4243 )
...
* Fix #10857 FN: leakNoVarFunctionCall
* Fix TODO
* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )
* #11155 FN: leakNoVarFunctionCall (ternary operator)
* Fix #11157 FN: leakNoVarFunctionCall (switch condition)
* Fix FN constStatement
* Fix FP leakNoVarFunctionCall
* Fix FP leakNoVarFunctionCall
* Format
* Fix FP leakNoVarFunctionCall with unknown function
* Fix FP leakNoVarFunctionCall
2022-06-30 13:05:28 +02:00
chrchr-github
06b408ea20
Fix FP leakNoVarFunctionCall with unknown function ( #4242 )
...
* Fix #10857 FN: leakNoVarFunctionCall
* Fix TODO
* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )
* #11155 FN: leakNoVarFunctionCall (ternary operator)
* Fix #11157 FN: leakNoVarFunctionCall (switch condition)
* Fix FN constStatement
* Fix FP leakNoVarFunctionCall
* Fix FP leakNoVarFunctionCall
* Format
* Fix FP leakNoVarFunctionCall with unknown function
2022-06-29 13:43:17 +02:00
chrchr-github
b90a726441
Fix FP leakNoVarFunctionCall ( #4241 )
...
* Fix #10857 FN: leakNoVarFunctionCall
* Fix TODO
* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )
* #11155 FN: leakNoVarFunctionCall (ternary operator)
* Fix #11157 FN: leakNoVarFunctionCall (switch condition)
* Fix FN constStatement
* Fix FP leakNoVarFunctionCall
* Fix FP leakNoVarFunctionCall
* Format
2022-06-29 07:22:26 +02:00
Paul Fultz II
185294499c
Adjust the severity of the uninitvar ( #4234 )
2022-06-28 22:52:35 +02:00
chrchr-github
f8b796403b
Fix #11146 Crash in expandTemplate() ( #4238 )
2022-06-28 22:43:34 +02:00
Paul Fultz II
a2f2699088
Refactor alias check in isExpressionChangeAt into isAlias function ( #4223 )
2022-06-28 22:40:59 +02:00
chrchr-github
2223cd24b9
Fix #11157 FN: leakNoVarFunctionCall (switch condition) ( #4240 )
...
* Fix #10857 FN: leakNoVarFunctionCall
* Fix TODO
* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )
* #11155 FN: leakNoVarFunctionCall (ternary operator)
* Fix #11157 FN: leakNoVarFunctionCall (switch condition)
* Fix FN constStatement
* Fix FP leakNoVarFunctionCall
2022-06-28 14:02:02 +02:00
chrchr-github
cdeebc15ea
Fix #11155 FN: leakNoVarFunctionCall (ternary operator) ( #4239 )
...
* Fix #10857 FN: leakNoVarFunctionCall
* Fix TODO
* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )
* #11155 FN: leakNoVarFunctionCall (ternary operator)
2022-06-27 20:55:09 +02:00
chrchr-github
e7e23e87c2
Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) ) ( #4237 )
...
* Fix #10857 FN: leakNoVarFunctionCall
* Fix TODO
* Fix #10858 FN: leakNoVarFunctionCall (if ( b && malloc ) )
2022-06-27 19:35:22 +02:00
chrchr-github
88bf11abba
Fix #10857 FN: leakNoVarFunctionCall ( #4236 )
...
* Fix #10857 FN: leakNoVarFunctionCall
* Fix TODO
2022-06-27 14:19:19 +02:00
chrchr-github
242afc389d
Fix #11148 Regression: Parameter \'ptr\' can be declared as pointer to const ( #4233 )
2022-06-25 21:42:55 +02:00
Daniel Marjamäki
d204c5f894
Tokenizer: Cleanup stuff in simplifyTokenList2
2022-06-25 17:09:51 +02:00
chrchr-github
63e567eb50
Remove simplifyKnownVariables() ( #4232 )
...
* Remove simplifyKnownVariables()
* Add some test cases back
* Remove unused functions
* Format
2022-06-25 08:38:17 +02:00
chrchr-github
60c1eef659
Fix FP containerOutOfBounds with std::map ( #4230 )
2022-06-23 20:26:47 +02:00
chrchr-github
f1212e66f7
Fix FP constVariable with 2D array. ( #4228 )
...
Test case #8717 was actually a FP as well.
2022-06-22 21:22:04 +02:00
Daniel Marjamäki
1d5166d70c
CheckClass: Fix false negatives for uninitMemberVar
2022-06-21 19:28:08 +02:00
chrchr-github
a658baf962
Fix #11143 FP: unreadVariable (remove simplifyMathExpressions()) ( #4227 )
...
* Fix #11143 FP: unreadVariable (remove simplifyMathExpressions())
* Remove unused function, tests
2022-06-21 15:42:23 +02:00
chrchr-github
0d4b4394bb
Fix FP with embedded zeros ( #4226 )
...
* Partial fix for #11137 FN: invalidFunctionArgStr printf argument
* Typo
* Remove <strz>, suppressions
* Add suppresion, remove <strz>
* Add suppressions
* Fix FP with embedded zeros
* Merge
2022-06-21 13:33:45 +02:00
chrchr-github
de2509f1ac
Fix FP with complex array size expression ( #4225 )
...
* Partial fix for #11137 FN: invalidFunctionArgStr printf argument
* Typo
* Remove <strz>, suppressions
* Add suppresion, remove <strz>
* Add suppressions
* Fix FP with complex array size expression
2022-06-21 00:12:11 +02:00
chrchr-github
5b9fa9657d
Partial fix for #11137 FN: invalidFunctionArgStr printf argument ( #4224 )
...
* Partial fix for #11137 FN: invalidFunctionArgStr printf argument
* Typo
* Remove <strz>, suppressions
* Add suppresion, remove <strz>
* Add suppressions
2022-06-20 20:02:22 +02:00
orbitcowboy
ff50a01d36
Fixed handling of PCRE rules, since 'simple' rules have been removed already, set default to 'normal'-tokenlist.
2022-06-20 09:17:11 +02:00
PKEuS
9eb16e1002
Replaced check for pipe() buffer size by ordinary CheckBufferOverrun, provide required Library configuration option ( #4183 )
...
Merged from LCppC.
2022-06-19 12:01:55 +02:00
Daniel Marjamäki
6873f5237b
Tokenizer: removing more stuff from simplifyTokenList2
2022-06-19 10:41:15 +02:00
Paul Fultz II
e735376f7d
Refactor to use AST for isContainerSizeChanged ( #4222 )
2022-06-19 08:17:05 +02:00
Paul Fultz II
e6fdcb9de2
Refactor to use derefShared ( #4220 )
2022-06-19 08:16:27 +02:00
Paul Fultz II
2a0b2f538e
Check tokType in match compiler ( #4219 )
...
* Check tokType in match compiler
* Set keyword when tokenlist is missing
2022-06-18 21:30:42 +02:00
Daniel Marjamäki
a7815ed5b0
Tokenizer: Remove more stuff from simplifyTokenList2
2022-06-18 07:31:36 +02:00
Daniel Marjamäki
aa8c17a701
Tokenizer: remove stuff from simplifyTokenList2
2022-06-17 09:44:58 +02:00
Paul Fultz II
3612ddb3f5
Fix unit test failure ( #4218 )
2022-06-17 07:49:45 +02:00
Daniel Marjamäki
968d8d153e
Fixed #11101 (False positive: derived union members are initialized in constructor)
2022-06-16 20:17:57 +02:00
Paul Fultz II
3e09503561
Fix 11087: false negative: usage of reference to member of temporary object not detected ( #4217 )
...
* Fix 11087: false negative: usage of reference to member of temporary object not detected
* Format
* Add another test case
* Fix FP with pointer
* Format
2022-06-16 19:26:36 +02:00
Paul Fultz II
9cecc8468e
Fix 10570: Improve check; condition then pointer dereference, different pointers ( #4216 )
...
* Try to use after assign in loop
* Update valueflow forward to handle init tokens
* Fix tests
* Make test TODO
* Format
* Add tests
* Format
* Fix ubsan error
* Use simpleMatch
2022-06-16 19:26:23 +02:00
Paul Fultz II
de51ebbcf4
Fix 9135: Access of moved variable not detected in loop ( #4215 )
...
* Fix 9135: Access of moved variable not detected in loop
* Format
* Fix issue with pushing back on container
* Format
* Fix null pointer
* Remove yeild for now
2022-06-16 17:40:09 +02:00
Daniel Marjamäki
dbb12cb333
Tokenizer: Remove some functions from simplifyTokenList2
2022-06-16 14:06:07 +02:00
Paul Fultz II
46fcdca5ee
Add debug_valuetype intrinsic ( #4210 )
2022-06-15 21:25:55 +02:00
chrchr-github
176eefcbf3
Fix #10655 FN bitwiseOnBoolean with unseen function ( #4214 )
2022-06-14 23:08:17 +02:00
chrchr-github
6d22d6a8ae
Fix FP unusedVar with side effects in destructor ( #4212 )
2022-06-14 09:55:22 +02:00
Daniel Marjamäki
343d04feb4
Tokenizer: Remove simplifyCharAt from simplifyTokenList2
2022-06-12 15:14:48 +02:00
Daniel Marjamäki
8255e32540
cppcheck build dir: do not produce invalid dump file if code is unchanged and checking is skipped.
2022-06-12 11:08:28 +02:00
Paul Fultz II
d4fb5652c0
Fix 10619: Valueflow: Library function in subfunction does not propagate all values ( #4209 )
2022-06-12 07:17:28 +02:00
Paul Fultz II
bd63534a1c
Fix 10740: valueflow; conditional value. incremented value is oob. ( #4208 )
2022-06-12 07:16:28 +02:00
Paul Fultz II
cee48e5e19
Add backtrace to valueflow in debug mode ( #4195 )
2022-06-12 07:13:42 +02:00
Rikard Falkeborn
187460a277
Library: Replace auto with real types ( #4207 )
...
Following up on fc6c203b0e
, replace auto with the correct types to
clairfy the code. Note the use of const on the first type in the pair,
which allows us to use a reference.
2022-06-11 23:21:25 +02:00
chrchr-github
ecb24e28bc
Fix #10191 FP redundantCopyLocalConst - referenced variable changes ( #4202 )
2022-06-11 16:58:33 +02:00
PKEuS
cb382ac52c
C++20 support: Support consteval and constinit ( #4203 )
...
Backported from LCppC.
2022-06-11 15:28:20 +02:00
Rikard Falkeborn
fc6c203b0e
Library: Use range-based for loops ( #4200 )
2022-06-11 13:51:55 +02:00
Paul Fultz II
8945c151f5
Fix 11124: FP knownConditionTrueFalse with fruit ( #4196 )
...
* Update valueType
* Allow comparisons
* Fix compare op
* Add test
* Format
* Fix FP
* Format
2022-06-11 11:02:04 +02:00
chrchr-github
8579feb3aa
Fix #10545 FP redundantCopyLocalConst with modified object [inconclusive] ( #4197 )
...
* Fix #10545 FP redundantCopyLocalConst with modified object [inconclusive]
* Comment
2022-06-11 11:01:23 +02:00
Paul Fultz II
653a1ea83e
Fix 11100: FP knownConditionTrueFalse with getter/setter member functions ( #4198 )
...
* Fix 11100: FP knownConditionTrueFalse with getter/setter member functions
* Format
2022-06-11 11:00:40 +02:00
PKEuS
82af702c6f
LCppC backport: Restored Check: Detect negative VLA and allocation (new[]) sizes ( #4187 )
2022-06-11 09:55:38 +02:00
Daniel Marjamäki
533b3e2bcb
Tokenizer: Clarify code. The variableMap.find, variableMap.end was not strictly matching.
2022-06-11 09:47:06 +02:00
PKEuS
99ce89c003
Improvement: Set varId for variables with global scope operator :: Refactorization: Moved internal class from tokenize.h to tokenize.cpp ( #4184 )
...
Merged from LCppC.
2022-06-11 08:11:16 +02:00
Paul Fultz II
c9b85010f9
Fix 11096: FP knownConditionTrueFalse in do while loop ( #4192 )
...
* Check for loop
* Improve handling of exit values
* Add more checks to test
* Simplify
* Remove unnecessary test
* Fix typo
* Format
* Use simpleMatch
2022-06-10 20:42:02 +02:00
chrchr-github
829ca9ab7f
Fix #10935 FP: compareBoolExpressionWithInt with enum and template parameter ( #4193 )
2022-06-10 20:40:37 +02:00
chrchr-github
51c8630bb3
Fix #10618 FP knownConditionTrueFalse with virtual function ( #4194 )
...
* Fix #10618 FP knownConditionTrueFalse with virtual function
* Remove redundant check
2022-06-10 20:17:57 +02:00
Daniel Marjamäki
375880988c
Tokenizer: remove removeRedundantAssignment from simplifyTokenList2
2022-06-10 12:35:05 +02:00
chrchr-github
90392faa2b
Fix crash on nullptr deref ( #4189 )
2022-06-09 18:25:17 +02:00
Daniel Marjamäki
a76ba698c2
Tokenizer: remove simplifyCompoundAssignment from simplifyTokenList2
2022-06-09 07:38:27 +02:00
Daniel Marjamäki
c0f3d5b2fb
Tokenizer: remove simplifyAssignmentInFunctionCall used in simplifyTokenList2
2022-06-08 19:08:18 +02:00
PKEuS
1275b5275e
LCppC backport: Various optimizations ( #4182 )
...
* Optimization: Use Token::eIncDecOp instead of expensive Token::Match calls
Merged from LCppC.
* Small Optimizations: - Moved a std::set that is only need during initialization of SymbolDatabase to function scope - Use std::vector instead of std::list
Merged from LCppC.
* Optimization: Refactorized various Token::Match calls and surrounding conditions
Merged from LCppC.
* Refactorization: Cleanup usage of std::multimap
Merged from LCppC.
2022-06-08 16:58:57 +02:00
PKEuS
4bd189c3c8
Refactorization: Faster calculation of CRC32 by avoiding to create a temporary string. Use proper types in checksum functions. ( #4180 )
...
Merged from LCppC
2022-06-08 16:55:06 +02:00
PKEuS
898a3a25a1
ValueType: Added additional unit test ( #4185 )
...
Removed unnecessary library export
Backported from LCppC.
2022-06-08 15:27:56 +02:00
PKEuS
d20ea41325
Refactorization: Removed compatibility hacks for outdated or non-conformant compilers ( #4186 )
...
Merged from LCppC.
2022-06-08 15:16:01 +02:00
PKEuS
44097b59ff
Implemented error handling in cppcheck::Platform::loadFromXmlDocument(), enabled related unit test ( #8409 ) ( #4181 )
2022-06-08 12:35:23 +02:00
Daniel Marjamäki
86a8d88729
Tokenizer: Remove simplification of math functions from simplifyTokenList2
2022-06-08 09:58:11 +02:00
chrchr-github
bb3f490edd
Fix #11090 Infinite recursion in findTypeInBase() ( #4178 )
2022-06-08 09:20:16 +02:00
Oliver Stöneberg
9367be804e
fixed `modernize-use-equals-delete` warnings in headers ( #4177 )
2022-06-07 21:25:23 +02:00
chrchr-github
69834d537b
Fix #9997 False negative: variable is not used ( #4104 )
2022-06-07 21:20:33 +02:00
chrchr-github
1d677c57a8
Fix #11126 FN: noExplicitConstructor with single default parameter ( #4174 )
2022-06-07 21:15:13 +02:00
chrchr-github
b80d06b69e
Don't warn for 'x | MACRO' when MACRO is 0 ( #4176 )
2022-06-07 21:13:31 +02:00
chrchr-github
52453947c8
Don't warn for 'x | 0' in macro ( #4172 )
...
* Fix #11082 FN badBitmaskCheck for binary or with 0
* Add test for #10703
* Don't warn for 'x | 0' in macro
* Add test for #10876
2022-06-06 11:17:36 +02:00
chrchr-github
f962436826
Fix #11082 FN badBitmaskCheck for binary or with 0 ( #4170 )
...
* Fix #11082 FN badBitmaskCheck for binary or with 0
* Add test for #10703
2022-06-04 17:25:10 +02:00
orbitcowboy
433ce58fe6
Fixed FP found with daca@home: ftp://ftp.de.debian.org/debian/pool/main/libs/libslirp/libslirp_4.7.0.orig.tar.bz2; head libslirp-v4.7.0/src/tftp.c:336:20: error: Invalid strcasecmp() argument nr 1. A nul-terminated string is required. [invalidFunctionArgStr]
2022-06-04 12:00:54 +02:00
orbitcowboy
1c1c72058f
Fixed FP found with daca@home: ftp://ftp.de.debian.org/debian/pool/main/libs/libslirp/libslirp_4.7.0.orig.tar.bz2; head libslirp-v4.7.0/src/tftp.c:336:20: error: Invalid strcasecmp() argument nr 1. A nul-terminated string is required. [invalidFunctionArgStr]
2022-06-04 07:46:28 +02:00
Oliver Stöneberg
ce945ec7fc
enabled and fixed `modernize-use-override` clang-tidy warnings ( #4168 )
2022-06-03 21:32:39 +02:00
chrchr-github
e6f2929fac
Fix #11085 FN constVariable with range-based for ( #4118 )
2022-06-03 19:24:59 +02:00
Oliver Stöneberg
cc08a661e6
astutils.h: reserve `std::vector` space in `visitAstNodes()` to avoid excess allocations ( #4158 )
2022-06-03 19:21:17 +02:00
orbitcowboy
00abf21d40
Format
2022-06-03 18:59:43 +02:00
orbitcowboy
a74bb485b0
Fixed TODO_ASSERT
2022-06-03 18:59:09 +02:00
orbitcowboy
6680bf9790
Fixed TODO_ASSERT
2022-06-03 18:35:11 +02:00
Oliver Stöneberg
d36e05af28
enabled and fixed `modernize-use-emplace` clang-tidy warnings ( #4165 )
...
* enabled and fixed `modernize-use-emplace` clang-tidy warnings
* avoid unnecessary creation of temporaries in `emplace_back()` calls
2022-06-03 15:09:29 +02:00
chrchr-github
111f4e17da
Fix #11117 FP nullPointerArithmetic when adding 0 ( #4167 )
2022-06-03 13:11:54 +02:00
orbitcowboy
1a4bd0a7b3
Fixed FP, found with daca@home: ftp://ftp.de.debian.org/debian/pool/main/k/knot/knot_3.1.8.orig.tar.xz; knot-3.1.8/tests/knot/test_confio.c:301:18: error: Invalid strcmp() argument nr 2. A nul-terminated string is required. [invalidFunctionArgStr]
2022-06-03 13:10:45 +02:00
orbitcowboy
7dac213734
Removed useless parentheses
2022-06-03 10:50:07 +02:00
orbitcowboy
9b0f41e1a0
Revert change 3dfe9eff3e (commitcomment-75236431)
.
2022-06-03 10:22:29 +02:00
orbitcowboy
c24edc528e
astutils.cpp: Removed useless parentheses
2022-06-03 00:18:35 +02:00
orbitcowboy
3dfe9eff3e
astutils.cpp: Improved const correctness
2022-06-03 00:07:15 +02:00
Paul Fultz II
72342de0da
Fix 11114: FP knownConditionTrueFalse across functions ( #4163 )
...
* Fix 11114: FP knownConditionTrueFalse across functions
* Format
2022-06-02 23:24:11 +02:00
orbitcowboy
67795cdfcf
Fixed FPs from Ticket 11119 - invalidFunctionArgStr with null-terminated strings ( #4164 )
...
* Fixed first FP from #11119 - invalidFunctionArgStr with null-terminated strings
* Fixed second test case from #11119 .
* Fixed another FP, found on daca@home ftp://ftp.de.debian.org/debian/pool/main/g/glhack/glhack_1.2.orig.tar.gz.
* Format
2022-06-02 19:30:29 +02:00
orbitcowboy
58460edaf8
Fixed crash due to missing null pointer check.
2022-06-02 11:32:55 +02:00
orbitcowboy
7275350f3e
Combined consecutive Token::simpleMatch() calls
2022-06-02 07:27:19 +02:00
orbitcowboy
3b2509c9cc
Fixed failing self-check: style: Call to 'Token::previous()' followed by 'Token::tokAt()' can be simplified. [redundantNextPrevious]
2022-06-02 07:16:09 +02:00
orbitcowboy
886b5d1039
Improved invalidFunctionArgStr checking and detect more cases where a NON-null-terminated string is used to call functions, configured with <strz/>.
2022-06-02 01:09:09 +02:00
chrchr-github
cd7362e0e7
Fix FN with default init ( #4162 )
...
* Fix #11099 FP: variableScope when using range constructor to vector
* Format
* Fix FN with default init
2022-06-01 23:18:59 +02:00
chrchr-github
2452a2c01d
Fix #11099 FP: variableScope when using range constructor to vector ( #4161 )
...
* Fix #11099 FP: variableScope when using range constructor to vector
* Format
2022-06-01 21:15:41 +02:00
Paul Fultz II
e430a11b49
Add debug_valueflow instrinsic to show valueflow values and its error path ( #4159 )
...
* Add debug_valueflow instrinsic to show valueflow values and its error path
* Format
2022-06-01 06:53:21 +02:00
Oliver Stöneberg
40bcbd47d6
small `Token::Match()` optimizations ( #4154 )
...
* token.cpp: fixed `readability-else-after-return` warnings in `Match()`
* token.cpp: removed some duplicated code from `Match()`
* token.cpp: use `strchr()` instead of loop in `Match()`
* token.cpp: added early exit and removed unnecessary loop condition in `Match()`
2022-05-31 13:52:34 +02:00
Oliver Stöneberg
3d5d2e8fd8
inlined `findAstNode()` calls ( #4146 )
2022-05-31 13:37:21 +02:00
chrchr-github
423e67bd6a
Fix FP memleak ( #4145 )
2022-05-30 06:55:15 +02:00
Paul Fultz II
d7c914bd3e
Handle subfunction values in valueflow conditions ( #4128 )
2022-05-29 19:57:10 +02:00
chrchr-github
7fbb9c7c13
Fix #10980 FN constVariable with range-based for loop ( #4144 )
...
* Fix #10980 FN constVariable with range-based for loop
* Format
* nullptr check
* Restrict scopes
* Add const
* Undo
* Add more const
2022-05-29 17:06:33 +02:00
chrchr-github
e1c51940a2
Fix #11095 FP constParameter with decremented pointer ( #4131 )
2022-05-28 08:32:58 +02:00
chrchr-github
16a4449901
Fix crash with statement expression ( #4142 )
2022-05-28 00:11:23 +02:00
chrchr-github
16af6561c2
Fix FP memleak with unknown ptr typedef ( #4141 )
...
* Fix #11019 FN memleak with redundant pointer op
* Style
* Fix #7705 FN: Memory leak not detected on struct member
* Fix FP memleak with function call, fix cppcheckError
* Fix FP memleak with array
* Fix FPs memleak with array and ptr to ptr
* Fix FP memleak with unknown ptr typedef
* Format
2022-05-27 23:52:56 +02:00
chrchr-github
d5d6da0dd4
Fix #11094 FP unreadVariable with unique_ptr and unknown type ( #4140 )
2022-05-27 17:17:50 +02:00
Rikard Falkeborn
068e5bad27
Fix #9966 : FP memleak with multiple assignments in if-statement ( #4138 )
...
Similar to how we do for assignments outside if-statements, bail out
since we do not track multiple variables.
2022-05-27 07:57:43 +02:00
chrchr-github
19dd59eae6
Fix FPs memleak with array and ptr to ptr ( #4139 )
...
* Fix #11019 FN memleak with redundant pointer op
* Style
* Fix #7705 FN: Memory leak not detected on struct member
* Fix FP memleak with function call, fix cppcheckError
* Fix FP memleak with array
* Fix FPs memleak with array and ptr to ptr
2022-05-26 15:27:36 +02:00
chrchr-github
86763b7b0a
Fix FP memleak with array ( #4133 )
...
* Fix #11019 FN memleak with redundant pointer op
* Style
* Fix #7705 FN: Memory leak not detected on struct member
* Fix FP memleak with function call, fix cppcheckError
* Fix FP memleak with array
2022-05-26 00:03:30 +02:00
orbitcowboy
eb3b8a6cec
checkAlwaysTrueOrFalseStringCompare: Added '_mbscmp_l' to list of functions.
2022-05-25 13:35:39 +02:00
chrchr-github
1ed280fe63
Fix FP memleak with function call, fix cppcheckError ( #4130 )
...
* Fix #11019 FN memleak with redundant pointer op
* Style
* Fix #7705 FN: Memory leak not detected on struct member
* Fix FP memleak with function call, fix cppcheckError
2022-05-24 14:02:06 +02:00
chrchr-github
2ceaf308de
Fix #11084 : ValueType for pointer typedef, don't warn for typedef'd pointers, improve error message ( #4123 )
...
* Fix ValueType for pointer typedef
* Add test
* Don't warn for typedef'd pointers, improve error message
* Fix tests
* Add TODO
* Fix test
* Set isSimplifiedTypedef() for more tokens, add test
* Add test
2022-05-24 10:09:48 +02:00
Paul Fultz II
7405ea039d
Refactor valueflow forward and reverse functions and unify them ( #4127 )
...
* Move functions around
* Make it a template to handle both overloads
* Simplify forward
* Remove container forward
* Remove unused settings params
* Format
* Remove valueFlowForwardExpression
* Format
* Remove init list
* Make const ref
* Remove braces
* Remove braces
2022-05-24 06:41:17 +02:00
Paul Fultz II
5999b35130
Fix 10944: FN: knownConditionTrueFalse ( #4124 )
...
* Fix 10944: FN: knownConditionTrueFalse
* Use or
* Format
2022-05-23 23:22:08 +02:00
chrchr-github
1ced94be43
Fix #11019 FN memleak with redundant pointer op / #7705 FN: Memory leak not detected on struct member ( #4126 )
...
* Fix #11019 FN memleak with redundant pointer op
* Style
* Fix #7705 FN: Memory leak not detected on struct member
2022-05-23 23:21:36 +02:00
Daniel Marjamäki
03c9253962
Token: add isRestrict flag
2022-05-22 14:10:55 +02:00
Paul Fultz II
e2c35abde5
Fix 11050: False positive: unreadVariable for class variable when another function uses the same variable name ( #4121 )
2022-05-22 09:20:32 +02:00
chrchr-github
22a4fdb6c4
Fix crash in checkPassByReference() ( #4122 )
2022-05-21 16:02:35 +02:00
Daniel Marjamäki
1f6554e2e8
Update copyright year
2022-05-21 12:18:27 +02:00
chrchr-github
2a7f00cf9a
Fix #8545 FN Condition '...' is always true ' uint16_t i; ( i <= 0xFFFF)' ( #4114 )
2022-05-21 08:33:42 +02:00
Paul Fultz II
feaef46436
Fix 11076: Assert failure / crash with loop over init list ( #4119 )
2022-05-21 08:25:09 +02:00
Paul Fultz II
a62fb986a5
Fix 11090: Infinite recursion in findTypeInBase() ( #4120 )
2022-05-21 08:24:29 +02:00
chrchr-github
2b723eafcb
Fix ValueType for references in range-based for loop ( #4116 )
...
* Fix ValueType for references in range-based for loop
* Format
2022-05-20 08:48:01 +02:00
chrchr-github
112b1573c5
Fix #11078 FN constructing string from nullptr / #11079 FN unread variables ( #4112 )
...
* Fix #11078 FN constructing string from nullptr / #11079 FN unread variables
* Format
2022-05-18 13:52:44 +02:00
Daniel Marjamäki
54ec666739
provide more details when executing addons fails
2022-05-18 08:36:20 +02:00
Paul Fultz II
90e6c10c12
Fix 11072: FP arrayIndexOutOfBounds, nullPointer with nested loops ( #4113 )
...
* Fix 11072: FP arrayIndexOutOfBounds, nullPointer with nested loops
* Format
* Remove print statement
2022-05-18 08:29:30 +02:00
Oliver Stöneberg
14421ae627
fail `run-clang-tidy` in case of compiler warnings / fixed Clang warnings / cleanups ( #4036 )
2022-05-15 12:42:29 +02:00
orbitcowboy
e02182bd88
Cleanup redundant parentheses
2022-05-15 07:53:32 +02:00
orbitcowboy
4f410ffb79
library: Improved argument <valid>-interface to defined values that are explicitly excluded. ( #4111 )
...
* library: Improved <valid>-interface to defined values that are explicitly excluded.
* std.cfg: Improved configuration of remainder[fl]().
* Fixed failing self check
* Fixed failing self check
* std.cfg: Added support for std::remquo().
2022-05-14 16:05:18 +02:00
chrchr-github
52f507d1fb
Fix #8004 unintentional semicolon in expression '.. ; +dostuff();' ( #4109 )
...
* Fix #8004 unintentional semicolon in expression '.. ; +dostuff();'
* Improve error message
* Don't remove single unary + in front of variables
2022-05-13 06:54:02 +02:00
Paul Fultz II
fbba72ab5a
Fix 11057: FP danglingTemporaryLifetime with reference member ( #4103 )
...
* Fix 11057: FP danglingTemporaryLifetime with reference member
* Add test
* Format
* Use ast for number of arguments
* Get number of arguments using ast
* Skip aggregate constructor when there are too many arguments
* Format
2022-05-13 06:51:07 +02:00
Paul Fultz II
5f9bee9b91
Fix 11056: FP uninitvar with known condition in loop ( #4107 )
...
* Fix 11056: FP uninitvar with known condition in loop
* Format
2022-05-12 06:37:48 +02:00
Paul Fultz II
5d8da2b83c
Fix 11035: FP arrayIndexOutOfBoundsCond with array and vector ( #4105 )
...
* Fix 11035: FP arrayIndexOutOfBoundsCond with array and vector
* Format
* Move comment
2022-05-12 06:21:33 +02:00
chrchr-github
e7e8b1baf9
Fix #9861 FN: "static" not suggested for non-const method ( #4101 )
...
* Fix #9861 FN: "static" not suggested for non-const method
* Format
* Make functions static
* static
2022-05-11 20:01:22 +02:00
chrchr-github
63a1698335
Fix #11059 FP multiCondition when variable is assigned in if/else ( #4102 )
2022-05-11 20:01:13 +02:00
chrchr-github
942dbad11c
Fix #7197 not getting expected warning in relational comparison of booleans ( #4095 )
...
* Fix #7197 not getting expected warning in relational comparison of booleans
* return nullptr
2022-05-11 08:09:32 +02:00
Daniel Marjamäki
72ba85a2fc
AST: Fix AST for array size calculation in cast (char (*)[...])
2022-05-10 22:47:57 +02:00
Daniel Marjamäki
4257f9d46a
Tokenizer: fix for __attribute__ before function that returns a reference
2022-05-10 20:59:24 +02:00
chrchr-github
a70d11adb6
Fix #11052 inline static global struct declaration interferes with checks ( #4098 )
2022-05-10 20:43:11 +02:00
chrchr-github
759c16fcef
Fix boolean expressions ( #4099 )
...
* Enable experimental check
* Remove experimental
* Don't compare Booleans using relational operators
* Fix boolean expressions
2022-05-10 20:42:24 +02:00
Daniel Marjamäki
0a4e2abf01
dump: add token isComplex attribute
2022-05-10 19:05:02 +02:00
chrchr-github
e2bb77f990
Remove severity 'experimental' from checkComparisonOfBoolWithBool() ( #4097 )
...
* Enable experimental check
* Remove experimental
* Don't compare Booleans using relational operators
2022-05-10 18:25:13 +02:00
chrchr-github
52cbbb0229
Fix FP uninitMemberVar with defaulted special member functions ( #4094 )
...
* Fix #10569 FN: duplicateExpression with multiple strings compared
* Fix compiler warning
* TODO -> ASSERT
* Update testautovariables.cpp
* Improve error message
* Format
* Improve message
* Fix FP with defaulted operator=
* Fix condition
2022-05-10 13:04:45 +02:00
chrchr-github
54f832a2fe
Fix #10569 FN: duplicateExpression with multiple strings compared ( #4087 )
2022-05-09 21:05:35 +02:00
chrchr-github
38bdece3fe
Fix #9391 False negative: Uninitialized struct member (default constructor) ( #4088 )
...
* Fix #9391 False negative: Uninitialized struct member (default constructor)
* Format
* Initialize variables
* Init
2022-05-09 20:28:21 +02:00
Paul Fultz II
be6daa94bb
Fix 11053: Integer division by zero in calculate.h ( #4092 )
...
* Fix 11053: Integer division by zero in calculate.h
* Format
2022-05-09 20:27:32 +02:00
Paul Fultz II
69f09da63e
Fix 11044: FP knownConditionTrueFalse after early return ( #4091 )
...
* Fix 11044: FP knownConditionTrueFalse after early return
* Format
2022-05-09 20:26:52 +02:00
Oliver Stöneberg
c71033548f
fixed some clang-tidy warnings ( #3080 )
2022-05-08 20:42:06 +02:00
Daniel Marjamäki
eb9c4b4aed
Tokenizer: Fix handling of __attribute__ for overloaded operator function
2022-05-08 18:19:52 +02:00
Daniel Marjamäki
fab55287f7
Tokenizer: improved handling of __asm__ in function declaration
2022-05-08 16:03:09 +02:00
Daniel Marjamäki
449d351095
Revert "Tokenizer: handle when __asm__ directive is provided for function"
...
This reverts commit f25b8cf662
.
2022-05-07 21:53:10 +02:00
Daniel Marjamäki
f25b8cf662
Tokenizer: handle when __asm__ directive is provided for function
2022-05-07 19:40:03 +02:00
chrchr-github
612d7be85a
Fix #11045 syntaxError with unknown macros and using namespace ( #4086 )
2022-05-05 19:47:56 +02:00
Paul Fultz II
843f7893d6
Fix 11040: FP nullPointer after loop ( #4085 )
2022-05-05 06:55:02 +02:00
Paul Fultz II
8d16ee946c
Fix 11027: False positive: containerOutOfBounds from condition in assert ( #4084 )
...
* Fix 11027: False positive: containerOutOfBounds from condition in assert
* Format
2022-05-05 06:54:44 +02:00
Paul Fultz II
5afd6880c3
Fix 11028: False positive: invalidContainer ( #4083 )
...
* Fix 11028: False positive: invalidContainer
* Format
2022-05-05 06:54:36 +02:00
chrchr-github
adba751217
Fix #11018 FP uninitvar with redundant pointer op ( #4082 )
...
* Skip redundant pointer op
* Fix #11018 FP uninitvar with redundant pointer op
* Format
2022-05-05 06:54:27 +02:00
chrchr-github
aebc080c0f
Fix #11041 FN constVariable with array of pointers [regression] ( #4080 )
...
* Fix #11041 FN constVariable with array of pointers [regression]
* Use std::vector for deterministic order of results, use helper variables
2022-05-05 06:54:03 +02:00
chrchr-github
9a379925cd
FIx FN shadowVariable in static function ( #4079 )
...
* FIx FN shadowVariable in static function
* Use functionOf
2022-05-04 17:56:16 +02:00
chrchr-github
e2069dd1b9
Fix #10650 FN knownConditionTrueFalse with const int value ( #4078 )
2022-05-04 14:25:00 +02:00
Paul Fultz II
496b45f27b
Fix 11009: FP uninitvar ( #4076 )
...
* Fix 11009: FP uninitvar
* Format
2022-05-04 05:59:01 +02:00
chrchr-github
1e40a2e73e
Fix #5210 C-style pointer casting not detected for casts to ** ( #4075 )
2022-05-03 20:15:42 +02:00
chrchr-github
509e42afd4
Fix #11034 FN duplicateCondition with struct member ( #4074 )
...
* Fix #11034 FN duplicateCondition with struct member
* Update testcondition.cpp
2022-05-03 19:57:30 +02:00
chrchr-github
51b4cf592b
Fix #11029 unknownMacro reported with noexcept (regression) ( #4073 )
2022-05-03 13:37:14 +02:00
Paul Fultz II
3edb10a006
Fix 11024: FP returnDanglingLifetime with c_str() passed to constructor ( #4072 )
2022-05-03 11:42:32 +02:00
chrchr-github
8ce0faf723
Fix #10427 Regression: selfInitialization ( #4070 )
2022-05-02 16:49:13 +02:00
chrchr-github
67f4fe575f
Fix #10978 syntaxError with attribute for function pointer ( #4069 )
2022-05-02 15:05:48 +02:00
chrchr-github
e9a0d7979e
Fix #11014 FN redundantPointerOp / remove simplifyMulAndParens() ( #4062 )
2022-05-01 15:46:07 +02:00
Paul Fultz II
3e686103ae
Fix 10984: False positive: invalidContainer when explictly capturing vector by reference ( #4064 )
2022-04-30 09:36:28 +02:00
Paul Fultz II
4e7125554f
Fix 8358: FP: Condition '(number*0)!=0' is always false ( #4065 )
2022-04-30 09:35:51 +02:00
Paul Fultz II
9fa5c4e201
Fix 11011: FP returnDanglingLifetime with non-const reference argument [inconclusive] ( #4066 )
...
* Fix 11011: FP returnDanglingLifetime with non-const reference argument [inconclusive]
* Format
2022-04-30 08:23:58 +02:00
chrchr-github
e7afb3045b
Fix FP redundantPointerOp with macro ( #4061 )
...
* Fix #10991 FN: Redundant pointer operation
* Fix FP redundantPointerOp
* Check for LValue
* Fix FP redundantPointerOp with macro
* Format
2022-04-29 13:23:50 +02:00
chrchr-github
0467ab1339
Fix #7923 FN memleak with cfg ( #4060 )
2022-04-28 19:50:16 +02:00
chrchr-github
8dbe6994a2
Fix FP redundantPointerOp ( #4058 )
...
* Fix #10991 FN: Redundant pointer operation
* Fix FP redundantPointerOp
* Check for LValue
2022-04-28 15:25:31 +02:00
chrchr-github
3d3885d151
Add test for #9838 / Remove noisy assert ( #4059 )
...
* Add test for #9838
* Remove noisy assert
2022-04-28 15:24:54 +02:00
Paul Fultz II
aafd1e10be
Fix 11006: FP uninitvar with unknown constant ( #4056 )
2022-04-28 10:48:37 +02:00
chrchr-github
7cedf3e0e5
Partial fix for #10983 False positive: returnTempReference with trailing return type ( #4055 )
2022-04-27 20:11:32 +02:00
chrchr-github
034140e7e1
Fix #10991 FN: Redundant pointer operation ( #4054 )
2022-04-27 19:52:56 +02:00
Paul Fultz II
3e3abecba0
Rename old uninitvar ID to use legacyUninitvar ( #4043 )
2022-04-27 17:37:37 +02:00
chrchr-github
bcbc29affb
Fix #10526 FP: negativeIndex if function call is made after index check ( #4052 )
...
* Fix #10526 FP: negativeIndex if function call is made after index check
* Improve container check
* Format
2022-04-27 14:08:44 +02:00
Paul Fultz II
474c7fe5cc
Fix 10953: False positive: Possible null pointer dereference when calling derived function ( #4044 )
2022-04-26 17:57:06 +02:00
Falital
e8a96932e1
Don't add suppressed errors to plist output ( #4038 )
2022-04-26 17:39:39 +02:00
chrchr-github
0dc3cb6eba
Fix #11007 FP nullPointerRedundantCheck with static function pointer ( #4051 )
2022-04-26 17:25:56 +02:00
chrchr-github
6b5df68677
Fix #11001 syntaxError for valid C code sizeof(enum ...) ( #4045 )
2022-04-26 07:22:53 +02:00
chrchr-github
961ecfbe33
Fix #11003 cppcheckError with nested template arguments ( #4049 )
2022-04-25 22:23:06 +02:00
chrchr-github
1bc0317719
Fix #11002 FP uninitStructMember with extra parentheses ( #4047 )
2022-04-25 22:22:35 +02:00
chrchr-github
b4df064875
Fix #11004 FP AssignmentIntegerToAddress with volatile ( #4046 )
2022-04-25 22:00:37 +02:00
chrchr-github
81f9b9b2b7
Fix FP with ptr to ptr const ( #4050 )
2022-04-25 21:45:11 +02:00
Paul Fultz II
6b9ac6f7a8
Warn when incrementing uninitialized value ( #4042 )
...
* Warn when incrementing uninitialized value
* Format
2022-04-24 09:56:58 +02:00
Paul Fultz II
5d5562266d
ValueFlow: Assume constant is nonzero when its negated ( #4041 )
...
* ValueFlow: Assume constant is nonzero when its negated
* Format
* Format
2022-04-23 06:19:07 +02:00
Paul Fultz II
4eed29502c
ValueFlow: Set values to parameters to longjmp and setjmp ( #4040 )
...
* ValueFlow: Set values to parameters to longjmp and setjmp
* Format
2022-04-23 06:18:55 +02:00
Oliver Stöneberg
fdca61add9
aligned build options of Visual Studio project configurations and added them to CMake ( #4020 )
2022-04-21 21:28:29 +02:00
Paul Fultz II
3feecc51d6
Fix 10988: FP: Regression, uninitvar ( #4037 )
2022-04-21 19:29:38 +02:00
Oliver Stöneberg
3feb496197
cppcheck.vcxproj: fixed yet another invalid standard setting in `Debug-PCRE` configuration for `cppcheck` causing build failures with SmallVector ( #4031 )
2022-04-21 09:21:59 +02:00
Oliver Stöneberg
7c9b9a65b1
cppcheck.vcxproj: fixed invalid standard setting in `Debug-PCRE` configuration for `cppcheck` causing build failures with SmallVector ( #4030 )
2022-04-20 20:29:43 +02:00
Oliver Stöneberg
36ef4dc5b8
added support for Qt6 ( #3930 )
2022-04-15 18:49:24 +02:00
Oliver Stöneberg
8f728cb4b6
added (partial) support for specifying C++23 and support more "-std" options ( #3212 )
2022-04-15 16:17:36 +02:00
chrchr-github
6e69b751eb
Fix Match pattern ( #4025 )
2022-04-15 08:48:49 +02:00
Paul Fultz II
28cf14f110
Fix 10975: false negative: dangling reference in class ( #4024 )
...
* Fix 10975: false negative: dangling reference in class
* Format
2022-04-14 18:59:12 +02:00
chrchr-github
6450d5701c
Fix #10979 FP arrayIndexOutOfBoundsCond with sizeof ( #4021 )
...
* Fix #10466 FP constVariable with pointer typedef
* Fix flag check
* Use isStatic()
* Fix #10979 FP arrayIndexOutOfBoundsCond with sizeof and extra parentheses
2022-04-14 18:13:29 +02:00
Paul Fultz II
6deb8068fa
Fix 10981: ValueFlow: multiplication with 0 should have known value 0 ( #4023 )
2022-04-14 18:13:04 +02:00
Paul Fultz II
09597bc7e8
Fix 10956: ValueFlow: Incorrect value when assigned to two variables ( #4019 )
...
* Fix 10956: ValueFlow: Incorrect value when assigned to two variables
* Format
2022-04-14 07:35:07 +02:00
chrchr-github
7721cd14b6
Fix #10466 FP constVariable with pointer typedef ( #4018 )
...
* Fix #10466 FP constVariable with pointer typedef
* Fix flag check
* Use isStatic()
2022-04-13 21:56:45 +02:00
Oliver Stöneberg
16e90ed3e2
smallvector.h: reverted bogus noExplicitConstructor fix and suppress the warning ( #4016 )
2022-04-13 20:50:04 +02:00
chrchr-github
8203c74c40
Fix #9648 FP sizeofDivisionMemfunc ( #4017 )
...
* Fix #9648 FP sizeofDivisionMemfunc when result is multiplied again with sizeof later
* Format
2022-04-13 18:21:56 +02:00
chrchr-github
938517b80a
Fix #10265 FP unused private method ( #4015 )
2022-04-13 14:49:28 +02:00
chrchr-github
f323e8a6c6
Fix #10311 FP functionConst ( #4012 )
...
* Fix #10311 FP functionConst
* Format
* Format
2022-04-13 12:25:36 +02:00
chrchr-github
55cb396d18
Fix #10494 Same template name confuses check ( #4011 )
2022-04-13 12:25:21 +02:00
chrchr-github
ea65fe2b63
Fix another FP divideSizeof ( #4009 )
...
* Fix FP divideSizeof
* Format
* Undo
* simpleMatch
* Fix another FP divideSizeof
2022-04-13 12:24:35 +02:00
Oliver Stöneberg
45158ec064
cleaned up includes based on include-what-you-use ( #4007 )
...
* cleaned up includes based on include-what-you-use
* updated translations
2022-04-13 12:24:00 +02:00
chrchr-github
5ac4afa5b8
Fix cppcheckError with spaceship operator ( #10251 ) ( #4001 )
...
* Fix cppcheckError with starship operator (#10251 )
* Fix test case
* Return result
2022-04-13 12:23:38 +02:00
Paul Fultz II
6c82fb05a4
Fix 10954: False positive: returnDanglingLifetime when using c_str() ( #4006 )
2022-04-12 08:09:13 +02:00
Paul Fultz II
61b87bcc60
Fix 10955: False positive: containerOutOfBounds when using a const reference member ( #4005 )
2022-04-12 08:07:55 +02:00
chrchr-github
00badff622
Fix #10315 FP functionConst ( #3997 )
...
* Fix #10315 FP functionConst
* Update releasenotes.txt
2022-04-11 22:55:16 +02:00
chrchr-github
28a024ac4a
Fix #9954 incorrectLogicOperator/knownConditionTrueFalse for constexpr ( #4002 )
2022-04-11 20:42:54 +02:00
chrchr-github
bf6bcafc56
Fix FP divideSizeof ( #4003 )
2022-04-11 20:41:59 +02:00
Oliver Stöneberg
a98346bbe0
generate a program database in all Visual Studio configurations ( #3996 )
2022-04-11 11:28:07 +02:00
Daniel Marjamäki
8f386e15fd
Remove bug hunting. This feature will be provided in Cppcheck premium.
2022-04-11 07:31:33 +02:00
Paul Fultz II
99757c6d06
ValueFlow: Set values to parameters to escape functions ( #3994 )
...
* ValueFlow: Set values to parameters to escape functions
* Format
2022-04-11 07:23:58 +02:00
Paul Fultz II
d97942d3c6
Fix 6577: Detect pointer to uninitialised memory with clock_settime() ( #3993 )
...
* Fix 6577: Detect pointer to uninitialised memory with clock_settime()
* Format
2022-04-11 07:23:44 +02:00
Paul Fultz II
45b4580554
Fix 10957: Crash on valid code ( #3991 )
2022-04-10 22:47:58 +02:00
chrchr-github
bd9f5231b8
Fix #10179 FP divideSizeof with dereferenced pointer-to-pointer ( #3786 )
2022-04-10 22:47:27 +02:00
chrchr-github
c8936d04f6
Fix #3886 New Check : Return value of "new" ignored ( #3884 )
2022-04-09 19:06:32 +02:00
Oliver Stöneberg
25ef9eeb26
use std::string::empty() ( #3910 )
2022-04-09 19:02:37 +02:00
chrchr-github
0636018df3
Fix #10368 FP: unassignedVariable with structured binding ( #3990 )
2022-04-09 14:50:30 +02:00
chrchr-github
2bccde0e3b
Fix #9789 FP Logical condition considered always false ( #3985 )
2022-04-09 14:09:10 +02:00
chrchr-github
38bc0ad4c3
Fix regression: wrong member variable ( #3987 )
2022-04-08 08:23:10 +02:00
Paul Fultz II
d2a0b0f78e
Fix 10951: FP knownEmptyContainer with east-const ( #3988 )
...
* Fix 10951: FP knownEmptyContainer with east-const
* Format
* Use simpleMatch
2022-04-08 08:22:39 +02:00
chrchr-github
ceb86afc22
Fix #10952 FP constStatement with cast in return ( #3986 )
2022-04-07 14:11:14 +02:00
Paul Fultz II
4c1aeb0cb1
Remove old pointer alias check ( #3983 )
2022-04-07 11:36:15 +02:00
chrchr-github
52b4aeb279
Fix #10792 FP knownConditionTrueFalse with double to int cast ( #3964 )
2022-04-07 10:42:57 +02:00
Paul Fultz II
dad10f2ab7
Fix 7684: ValueFlow: function call 'X::GetSize()' ( #3984 )
...
* Improve getting function to calculate the return
* Add test
* Format
* Move to cpp to avoid FP
* Format
2022-04-07 06:49:25 +02:00
Paul Fultz II
74667d1e2a
Fix 10418: false negative: knownConditionTrueFalse ( #3981 )
...
* Improve handling inverted condition
* Fix tests
* Rename variables for clarity
* Add initial test
* Add another test
* Format
* Fix FP
2022-04-07 06:48:13 +02:00
Paul Fultz II
09c8cfb2ae
Fix 6624: false negative: std::vector out of bounds access not detected ( #3980 )
...
* Fix 6624: false negative: std::vector out of bounds access not detected
* Format
* Add test for auto
* Fix tests
* Format
2022-04-07 06:47:15 +02:00
Paul Fultz II
bb640c4879
Fix 10950: Crash on function declaration ( #3979 )
...
* Fix 10950: Crash on function declaration
* Format
2022-04-06 19:00:05 +02:00
chrchr-github
b73aeeda0e
Fix FP constStatement with comma operator ( #3978 )
...
* Fix FP constStatement with comma operator
* Format
2022-04-06 16:58:17 +02:00
Paul Fultz II
4fde7f8b18
Fix 10449: Regression: knownConditionTrueFalse (strlen/wcslen) ( #3977 )
...
* Refactor library function usage
* Evaluate library function in program memory
* Fix and add tests
* Format
2022-04-06 06:35:38 +02:00
Paul Fultz II
1d92665ad2
Fix 10867: false negative: containerOutOfBounds with std::array (regression) ( #3976 )
...
* Fix 10867: false negative: containerOutOfBounds with std::array (regression)
* Format
2022-04-06 06:25:28 +02:00
chrchr-github
4c375e7224
Fix #9815 FP redundantInitialization with lambda / #10864 debug: valueFlowConditionExpressions bailout ( #3970 )
...
* Fix #9815 FP redundantInitialization with lambda
* Fix #10864 debug: valueFlowConditionExpressions bailout
* Format
2022-04-05 23:19:17 +02:00
chrchr-github
f5313dc519
Fix crash with defaulted destructor ( #3975 )
2022-04-05 23:18:08 +02:00
chrchr-github
c4dcfef385
Fix #10260 debug: Executable scope 'x' with unknown function. ( #3974 )
...
* Fix #10174 debug: Executable scope 'x' with unknown function
* Format
* Add test for #10198
* Fix #10260 debug: Executable scope 'x' with unknown function.
2022-04-05 15:52:16 +02:00
chrchr-github
cfbbeb4b1b
Partial fix for #10867 FN containerOutOfBounds with std::array ( #3971 )
...
* Partial fix for #10867 FN containerOutOfBounds with std::array
* Format
* Format
* Optimize
2022-04-05 07:34:20 +02:00
chrchr-github
b79885c6af
Fix #10174 debug: Executable scope 'x' with unknown function ( #3972 )
...
* Fix #10174 debug: Executable scope 'x' with unknown function
* Format
2022-04-05 07:34:06 +02:00
chrchr-github
aae810dd2c
Fix #10107 FP: duplicateValueTenary ( #3969 )
2022-04-04 06:33:54 +02:00
chrchr-github
955d6d8fc6
Fix #10793 internalAstError with brace-init in ternary ( #3966 )
...
* Fix #10793 internalAstError with brace-init in ternary
* Undo
2022-04-03 20:05:03 +02:00
Paul Fultz II
39265f8ce0
Fix 10931: Assert failure in setSymbolic() ( #3967 )
...
* Fix 10931: Assert failure in setSymbolic()
* Format
2022-04-03 20:04:18 +02:00
Paul Fultz II
0547cbcd26
Fix 10647: FN knownConditionTrueFalse for impossible Boolean value ( #3968 )
...
* Add impossible values for bool
* Fix valueflow tests
* Fix assertion failure
* Add test
* Format
2022-04-03 20:04:05 +02:00
chrchr-github
7a7b3e40eb
Fix regression FN constVariable with static arrays ( #3965 )
...
* Fix regression FN constVariable with static arrays
* Fix test case
2022-04-02 20:39:45 +02:00
chrchr-github
a9f29fbc09
Fix #10307 FP functionStatic with class template and east-const / #10471 FP constParameter with std::array and east-const ( #3963 )
2022-04-01 23:26:44 +02:00
Daniel Marjamäki
ea63b8e2bb
misra: fix void parameter check
2022-04-01 21:34:47 +02:00
chrchr-github
4bf8718dcb
Fix #10849 FP constStatement with pointers in lambda ( #3961 )
2022-04-01 19:50:40 +02:00
Paul Fultz II
5bea50cd36
Fix 10908: FP: uninitvar after for-loop ( #3942 )
2022-03-31 21:24:20 +02:00
chrchr-github
183969cd4b
Fix #10936 FP constStatement with extern declaration ( #3960 )
2022-03-31 21:08:04 +02:00
chrchr-github
c85e7e7d2f
Fix FP constStatement with more complex expression ( #3959 )
2022-03-30 22:00:57 +02:00
Paul Fultz II
32ded1602b
Fix warnings in switch statements on clang ( #3943 )
2022-03-30 19:30:02 +02:00
Jens Yllman
34a11c1673
Fix unmatched suppression ( #5704 ) ( #3886 )
2022-03-30 19:24:53 +02:00
chrchr-github
343a23135d
Fix #10932 FP constStatement with reference and direct initialization ( #3952 )
2022-03-30 19:22:01 +02:00
chrchr-github
47ba053054
Fix #10744 FP constVariable with static pointer ( #3957 )
2022-03-30 19:21:09 +02:00
chrchr-github
86ff360946
Fix #10917 FP constStatement with immediately evaluated lambda ( #3956 )
2022-03-29 06:10:57 +02:00
chrchr-github
81bcbfa7fe
Fix #10920 FP missingOverride with friend ( #3955 )
2022-03-28 22:44:04 +02:00
chrchr-github
49147f95fe
Fix #10918 FP constStatement with dynamic_cast ( #3954 )
2022-03-28 22:15:40 +02:00
chrchr-github
8d49fc252c
Fix FP constStatement ',' with Eigen, OpenCV etc. ( #3950 )
2022-03-28 22:06:44 +02:00
chrchr-github
11cbb2eb00
Fix AST cyclic dependency [cppcheckError] 3 ( #3953 )
2022-03-28 22:05:41 +02:00
chrchr-github
d57d536f01
Fix #10882 FP constStatement with negation and cast ( #3951 )
2022-03-28 21:52:08 +02:00
chrchr-github
7b97230dd2
Fix #10505 FP unreadVariable for lock_guard variable ( #3938 )
2022-03-28 21:45:49 +02:00
Oliver Stöneberg
8bf8070923
fixed build with SmallVector (noExplicitConstructor warning and incorrect C++ standard for Visual Studio `*-PCRE` configuration) ( #3937 )
2022-03-28 21:40:44 +02:00
Paul Fultz II
54fbfd7c0f
Fix 10895: FP danglingTempReference with emplace() ( #3948 )
...
* Fix 10895: FP danglingTempReference with emplace()
* Format
2022-03-27 10:02:30 +02:00
Paul Fultz II
21b8c36eb1
Fix 10916: FP: uninitvar ( #3949 )
2022-03-27 10:01:58 +02:00
chrchr-github
63d96e49fc
Fix #10928 , #10930 FP constStatement ( #3946 )
...
* Fix #10928 , #10930 FP constStatement
* Fix test cases (first one did not compile)
2022-03-27 07:59:29 +02:00
chrchr-github
401f0de18b
Fix #10929 FP constStatement with new ( #3947 )
2022-03-27 07:59:19 +02:00
chrchr-github
1dd19dcaef
Fix AST cyclic dependency [cppcheckError] ( #3945 )
2022-03-26 22:39:14 +01:00
chrchr-github
5ed521622f
Fix #10923 FP constStatement with ptr to ptr to ptr ( #3944 )
...
* Fix #10923 FP constStatement with ptr to ptr to ptr
* simpleMatch
2022-03-26 06:12:26 +01:00
chrchr-github
fe7d0eeffc
Fix #10919 FP: constStatement with template type ( #3941 )
2022-03-25 17:03:54 +01:00
chrchr-github
12cb19bdf2
Fix AST cyclic dependency [cppcheckError] ( #3940 )
2022-03-25 14:03:32 +01:00
chrchr-github
e54ad24d2c
Fix #10870 FN constStatement with arrays ( #3904 )
2022-03-25 11:32:16 +01:00
chrchr-github
796ad6c008
Fix #10913 FP variableScope - vector referenced via iterator ( #3936 )
2022-03-25 09:21:17 +01:00
Daniel Marjamäki
212ac6c214
compile_commands.json: ensure that order of include paths are kept
2022-03-24 22:50:04 +01:00
Daniel Marjamäki
4365704f14
cppcheck.cfg: support custom productname and about message
2022-03-24 22:44:47 +01:00
chrchr-github
3630e9c49d
Fix #10874 FP constStatement with extra parentheses in declaration ( #3931 )
2022-03-24 22:07:21 +01:00
chrchr-github
479af21405
Fix #10698 FP uninitvar with new and braced initializer ( #3934 )
2022-03-24 20:08:51 +01:00
Paul Fultz II
4b4037540a
valueFlowUninit: Handle arrays and pod types ( #3917 )
...
* valueFlowUninit: Handle arrays and pod types
* Format
* Catch another array case
2022-03-24 06:35:44 +01:00
Daniel Marjamäki
3bcbba598d
Fixed #10887 (compile database: include path with space is not handled)
2022-03-23 21:13:51 +01:00
chrchr-github
0d2af9a5b7
Fix #10880 FP constStatement with init list in function call ( #3929 )
2022-03-23 18:10:33 +01:00
chrchr-github
e0830693c3
Fix FP uninitMemberVarPrivate with anonymous union ( #3927 )
2022-03-23 07:35:41 +01:00
chrchr-github
39567ea8c8
Fix #8541 FP variableScope (std::for_each with lambda) ( #3924 )
2022-03-22 21:50:46 +01:00
chrchr-github
40c2687ac4
Fix #10875 FP constStatement with delete ( #3926 )
2022-03-22 18:39:02 +01:00
chrchr-github
3faff5e9fc
Fix #10248 FP knownConditionTrueFalse static variable with direct initialization ( #3922 )
2022-03-22 07:24:40 +01:00
chrchr-github
18a7a805df
Fix #10502 FP doubleFree ( #3921 )
2022-03-21 22:17:50 +01:00
Daniel Marjamäki
1fe7cd348a
exename: Set proper exename when cppcheck is executed from PATH and argv[0] does not contain path information
2022-03-21 18:35:53 +01:00
chrchr-github
0e147502cc
Fix #10888 FN variableScope with enum and struct ( #3920 )
...
* Fix #10888 FN variableScope with enum and struct
* Scope reduction
* Scope reduction
2022-03-21 16:05:38 +01:00
Oliver Stöneberg
9d4fb16d7d
added SmallVector alias with conditional boost::container version ( #3799 )
...
* printInfo.cmake: small cleanup
* added SmallVector alias with conditional boost::container version
Co-authored-by: Ken-Patrick Lehrmann <kp.lehrmann+github@gmail.com>
* smallvector.h: added custom allocator to regular SmallVector version
Co-authored-by: Ken-Patrick Lehrmann <kp.lehrmann+github@gmail.com>
Co-authored-by: Paul Fultz II <pfultz2@yahoo.com>
2022-03-20 10:13:32 +01:00
chrchr-github
2baf8f6cd4
Fix FP virtualCallInConstructor with function pointer ( #3913 )
2022-03-19 20:00:06 +01:00
chrchr-github
297b0b5c60
Fix #10886 FP: Label 'enum' is not used. [unusedLabel] ( #3912 )
2022-03-17 17:38:23 +01:00
chrchr-github
97ce569859
Fix #10873 FP constStatement with extra parentheses in function call ( #3911 )
...
* Fix #10873 FP constStatement with extra parentheses in function call
* Format
2022-03-17 12:47:27 +01:00
chrchr-github
e073860e62
Fix #10841 FN uninitMemberVar when member is being used in constructor (regression) ( #3909 )
2022-03-16 20:35:55 +01:00
Paul Fultz II
40ff9edad6
Fix 10843: FP: danglingTemporaryLifetime ( #3908 )
...
* Fix 10843: FP: danglingTemporaryLifetime
* Format
2022-03-16 17:11:49 +01:00
chrchr-github
fb1170b10b
Fix #10872 FP constStatement with variable called std ( #3906 )
2022-03-16 15:29:34 +01:00
chrchr-github
b8ba0ae00e
Fix #10877 FP constStatement with ternary and comma operator ( #3905 )
2022-03-16 15:28:59 +01:00
Armin Müller
7cc45fb393
Typos found by running "codespell" ( #3907 )
...
Co-authored-by: Armin Müller <mueller.armin@foestergroup.de>
2022-03-16 15:28:44 +01:00
chrchr-github
1aff160411
Fix #9303 FP uninitvar after lambda expression ( #3903 )
...
* Fix #9303 FP uninitvar after lambda expression
* Format
2022-03-15 14:32:33 +01:00
chrchr-github
200b098471
Fix #10516 FP for unused private function if address of function is taken ( #3901 )
2022-03-14 19:15:48 +01:00
chrchr-github
6376bac5bb
Fix #10451 syntaxError with typedef and lambda ( #3900 )
...
* Fix #10451 syntaxError with typedef and lambda
* Don't insert union into template argument list, add test
* Format
* Revert "Format"
This reverts commit 8c52d49c8b
.
* Format
2022-03-14 17:59:29 +01:00
chrchr-github
d3d40fd599
Fix #10868/#10869 FN: constStatement, handle unused character constants ( #3898 )
...
* Fix #10868 FN: constStatement, handle unused character constants
* simpleMatch
* Fix #10869 FN: constStatement
* Format
2022-03-14 14:14:32 +01:00
Oliver Stöneberg
0d336b868c
avoid some Clang compiler warnings ( #3896 )
2022-03-13 20:07:58 +01:00
chrchr-github
2eed660b32
Fix #8496 Clarify warnings for uninitMemberVar ( #3760 )
2022-03-13 17:33:31 +01:00
chrchr-github
190506db40
Fix #10737 Regression: unusedStructMember ( #3894 )
...
* Fix #10737 Regression: unusedStructMember
* Add test for #9161
* simpleMatch
2022-03-13 06:27:17 +01:00
chrchr-github
c3506b5186
Fix #10691 regressions with static variables and multiple assignments ( #3895 )
...
* Fix regressions with static variables and multiple assignments
* Fix test
* Fix test cases
2022-03-13 06:26:21 +01:00
Oliver Stöneberg
757287b13c
removed unnecessary varid0 inline suppressions ( #3893 )
2022-03-12 18:02:40 +01:00
chrchr-github
3df170c191
Fix #10865 FN: constStatementError, streamline error messages ( #3892 )
2022-03-12 14:52:18 +01:00
chrchr-github
d1f740a289
Partial fix for #9384 varid 0 with lambda (II) ( #3889 )
...
* Partial fix for #9384 varid 0 with lamba
* Format
* Undo
* Undo
* Partial fix for #9384 varid 0 with lambda (II)
2022-03-12 06:17:37 +01:00
chrchr-github
4c85ac0d7b
Fix #10852 FP unused struct member (inner struct in C code) ( #3890 )
...
* Fix #10852 FP unused struct member (inner struct in C code)
* Redundant findType() call, add test
2022-03-12 06:16:29 +01:00
Paul Fultz II
ff902369e0
Fix 10851: False positive: known variable value below for loop ( #3891 )
...
* Fix 10851: False positive: known variable value below for loop
* Format
* Add test for 10863
* Format
2022-03-12 06:15:35 +01:00
chrchr-github
705931266c
constStatementError: don't warn for casts with possible side effects,… ( #3885 )
...
* constStatementError: don't warn for casts with possible side effects, handle bool constants
* Recursive call, add tests
* Restore test
* Don't warn for C++ casts to void
* Don't warn for cast to void*
2022-03-11 21:45:51 +01:00
chrchr-github
ffd9f9a93f
Fix FP missingOverride with unnamed parameters ( #3887 )
2022-03-11 21:44:13 +01:00
Binho
8b3647edd7
Fix false positive in memory leak
2022-03-10 08:29:05 +01:00
chrchr-github
2616046461
Partial fix for #10848 FP: unusedStructMember ( #3880 )
2022-03-09 20:25:58 +01:00
chrchr-github
557263acde
Partial fix for #10848 FP: unusedStructMember (II) ( #3881 )
...
* Preliminary
* Fix member search, add tests
2022-03-09 18:22:30 +01:00
chrchr-github
850ad0fed9
#8451 : Add error message for unused casts, log unhandled errors ( #3883 )
...
* #8451 : Add error message for unused casts, log unhandled errors
* Fix TODO
* Fix TODO
2022-03-09 18:21:47 +01:00
chrchr-github
c9f47dec8b
Partial fix for #9384 varid 0 with lambda ( #3875 )
2022-03-08 20:10:51 +01:00
chrchr-github
fbdfb60809
Warn about buffer overruns when allocating memory with new ( #3879 )
...
* Warn about buffer overruns when allocating memory with new
* Format
* Avoid FP
2022-03-07 19:43:40 +01:00
chrchr-github
3a5931b417
Fix #5499 C++11 default values not for all class fields and missing constructor ( #3876 )
2022-03-07 08:39:19 +01:00
chrchr-github
7f682d544e
Partial fix for #6615 FN buffer access out of bounds: std::vector ( #3873 )
...
* Fix #10779 FN: stlOutOfBounds (off by one)
* Format
* Simplify
* Partial fix for #6615 FN buffer access out of bounds: std::vector
* Undo
* Format
* Fix test case
2022-03-06 07:41:09 +01:00
chrchr-github
0b0a8cad39
Fix #10846 FP unreadVariable within a macro (regression) ( #3874 )
...
* Fix #10846 FP unreadVariable within a macro (regression)
* Format
* Format
2022-03-05 08:14:57 +01:00
chrchr-github
27baa20f38
Fix #10779 FN: stlOutOfBounds (off by one) ( #3872 )
...
* Fix #10779 FN: stlOutOfBounds (off by one)
* Format
* Simplify
2022-03-04 17:13:13 +01:00
chrchr-github
2dd6c75b35
Fix #10838 Crash/nullptr deref in getEndOfExprScope() ( #3870 )
...
* Fix #10838 Crash/nullptr deref in getEndOfExprScope()
* Format
2022-03-03 17:08:23 +01:00
chrchr-github
78dd29ada3
Fix #10770 FP noConstructor with function pointer member ( #3751 )
2022-03-03 13:56:24 +01:00
chrchr-github
8a7992c6ac
Suppress operatorEqVarError for known non-copyable types ( #3869 )
...
* Fix FP operatorEqVarError with class hierarchy
* Suppress operatorEqVarError for std::mutex
* Add test, non-copyable Qt types
* Update cppcheck-cfg.rng
2022-03-03 09:41:26 +01:00
Daniel Marjamäki
915ae4b845
ValueFlow: Fix crash
2022-03-02 21:12:37 +01:00
chrchr-github
9c50136571
Fix #10824 FN unreadVariable for pointer assignment when destructor exists (regression) ( #3864 )
...
* Fix #10824 FN unreadVariable for pointer assignment when destructor exists (regression)
* unused variable
* Issue warning for missing cfg
* Format
2022-03-02 11:11:44 +01:00
Oliver Stöneberg
4a63af02ed
enabled functionConst and functionStatic in selfcheck ( #3862 )
...
* fixed functionConst findings and enabled it in selfcheck
* fixed functionStatic findings and enabled it in selfcheck
* .travis_suppressions: adjusted comment
* testimportproject.cpp: added missing asserts
2022-03-02 07:46:47 +01:00
chrchr-github
8e8e6b1170
Fix FP operatorEqVarError with class hierarchy ( #3868 )
2022-03-02 07:46:23 +01:00
chrchr-github
01de8256ea
Fix #10798 cppcheckError with enum class and typedefs ( #3867 )
...
* Fix #10798 cppcheckError with enum class and typedefs
* Format
* Format
* Leave enum class scope
* Remove comment
2022-03-02 07:46:15 +01:00
chrchr-github
43fb3dd047
Fix regression: wrong varid with using namespace ( #3866 )
...
* Fix #10059 missing varId with using namespace
* Undo
* Fix test
* Limit namespace candidates, duplicateBranch
* rvalue ref
* Undo
* Undo
* Undo
* Format
* Fix condition
* Fix regression: wrong varid with using namespace
2022-03-02 07:46:04 +01:00
Paul Fultz II
0b310b9d07
Fix 10702: FP knownConditionTrueFalse - Member variable modified ( #3857 )
...
* Fix 10702: FP knownConditionTrueFalse - Member variable modified
* Format
* Make parameter const
* Fix FP
* Fix FP
* Update
* Format
2022-02-28 18:54:55 +01:00
chrchr-github
6a8bd981b5
Fix #10825 CheckClass::isMemberVar found used member variable with varid 0 ( #3863 )
...
* Fix #10825 CheckClass::isMemberVar found used member variable with varid 0
* Restore call to simpleMatch()
2022-02-28 18:28:23 +01:00
José Martins
b1e92fc399
Misra false positive fixes for rules 8.7 and 5.9 ( #3844 )
...
* Fix misra 8.7 false positives on single function usage
When there is a single usage of a function, we should first check if the
file it is used in, is the same one it was defined in. When this is not the
case, there is no violatior to be reported.
* Fix misra rule 5.9 false positives for exception
The exception for rule 5.9 described in the guidelines allows for
multiple definitions of internal linkage obejcts when these regard a
static inlined function defined in the same header file.
* Fix neglecting of inline keyword flag upon simplifications
When the inline keyword is being "simplified" and the inline flag is
degated to the next token. However, this information might be lost if the next
token itself is simplified/deleted in a futher pass. Therefore, we must
propagated the flag to all the next named tokens, so we can make sure the
function name token itself is tagged with this property.
* add tests for misra addon rules 8.7 and 5.9
2022-02-27 19:17:48 +01:00
chrchr-github
05a6d09c5f
Fix #10360 FP uninitMemberVar from copy constructor [inconclusive] ( #3748 )
2022-02-27 19:15:19 +01:00
chrchr-github
ddb0a8bb0b
Fix #10059 missing varId with using namespace ( #3860 )
...
* Fix #10059 missing varId with using namespace
* Undo
* Fix test
* Limit namespace candidates, duplicateBranch
* rvalue ref
* Undo
* Undo
* Undo
* Format
* Fix condition
2022-02-27 09:03:24 +01:00
chrchr-github
d79d6e60db
Fix #10828 Internal error. Token::Match called with varid 0 ( #3859 )
...
* Fix #10828 Internal error. Token::Match called with varid 0
* Fix test
2022-02-26 23:48:29 +01:00
chrchr-github
441b437cea
Fix #10826 FN: unusedStructMember ( #3858 )
2022-02-26 18:53:00 +01:00
Paul Fultz II
dbc80787e1
Fix 10821: FN: containerOutOfBounds ( #3856 )
...
* Fix 10821: FN: containerOutOfBounds
* Format
* Fix cppcheck warning
* Add valueflow tests
* Format
* Fix some bugs
* Format
2022-02-25 05:53:51 +01:00
Paul Fultz II
45de9a7d08
Refactor: Use getEndOfExprScope instead of getEndOfVarScope ( #3855 )
2022-02-24 06:50:34 +01:00
chrchr-github
f53793c413
Fix #10823 FP cstyleCast with function pointer and calling convention ( #3853 )
2022-02-23 09:12:14 +01:00
Oliver Stöneberg
51371f7929
added CMake option USE_THREADS to be able to use threads instead of fork() / cleanups ( #3852 )
2022-02-23 09:04:35 +01:00
chrchr-github
172aafdeb8
Fix #7908 FN: redundant assignment in loop ( #3650 )
2022-02-22 09:51:44 +01:00
Paul Fultz II
1ac16413ea
Another fix for 10800: Hang / memory exhaustion on numerical code ( #3851 )
...
* Another fix for 10800: Hang / memory exhaustion on numerical code
* Format
2022-02-22 07:21:26 +01:00
Paul Fultz II
72d0f3e444
Fix 10808: cppcheckError AST cyclic dependency with decltype ( #3850 )
...
* Fix 10808: cppcheckError AST cyclic dependency with decltype
* Format
2022-02-22 06:30:17 +01:00
Oliver Stöneberg
b6876d22e6
use inline suppressions for varid0 in selfcheck ( #3842 )
2022-02-21 18:35:02 +01:00
Bart vdr. Meulen
20601c1b01
Restore symbol names from cache
...
When reading earlier reported errors from the cache file the symbol names are not handled. This causes suppressions to no longer match when rerunning cppcheck.
2022-02-21 18:19:05 +01:00
chrchr-github
734e3ac6da
Fix cppcheckError with for loop ( #3847 )
2022-02-21 18:14:20 +01:00
chrchr-github
bedde0a1df
Fix #10391 bug hunting; crash for small C-code ( #3846 )
2022-02-21 18:09:46 +01:00
chrchr-github
d77fa64051
Fix #10256 Function::addArguments found argument 'x' with varid 0 ( #3845 )
2022-02-21 18:06:26 +01:00
chrchr-github
5574e41b86
Fix #10065 CheckClass::isMemberVar found used member variable with varid 0 ( #3843 )
2022-02-20 18:17:47 +01:00
chrchr-github
18e00bb4fd
Fix #10817 Crash in checkPassByReference() / #10810 Stack overflow with decltype / #10763 Crash on invalid code ( #3840 )
...
* Fix #10817 Crash in checkPassByReference()
* Format
* Fix #10810 Stack overflow with decltype
* Fix #10763 Crash on invalid code in TemplateSimplifier::templateParameters
2022-02-18 12:59:21 +01:00
chrchr-github
6635e6cc07
Fix #10795 cppcheckError with for loop ( #3841 )
2022-02-17 22:12:19 +01:00
chrchr-github
b07814f329
Fix #3462 FN missed class members in copy operator of derived class ( #3837 )
2022-02-16 21:30:19 +01:00
Daniel Marjamäki
c968aeaf73
Import project: do not crash when importing compile database generated by IAR workbench
2022-02-16 08:35:47 +01:00
chrchr-github
9582032906
Fix #8485 FP uninitMemberVar - ctor calls function with smart pointer argument ( #3835 )
2022-02-16 07:02:26 +01:00
chrchr-github
52f549fa87
Fix crash on garbage code ( #3834 )
2022-02-15 20:19:03 +01:00
chrchr-github
907218254e
#8126 Fix previous commit ( #3833 )
...
* Fix #8126 unsafeClassCanLeak missing for array of pointers
* #8126 Fix previous commit
* Format
* Format
2022-02-15 20:03:02 +01:00
chrchr-github
e7e2439347
Fix #8126 unsafeClassCanLeak missing for array of pointers ( #3832 )
2022-02-15 14:28:19 +01:00
Oliver Stöneberg
75b6e8d258
inline visitAstNodes() calls ( #3828 )
2022-02-13 20:46:01 +01:00
Daniel Marjamäki
d5ef25e477
Add constParameter and constParameterCallback in --errorlist output
2022-02-13 16:17:53 +01:00
José Martins
c8211ec6f6
Fix check for misra addon in executeAddons. ( #3819 )
...
In the CppCheck::executeAddons function, a check that specifically tests
for the misra add-on, was not taking into account the cases when the
addon is identified with the '.py' extension or indirectly via json.
This resulted in the add-on not being executed a second time which is
needed to detected some of the misra violations. By using the AddonInfo
class name field, the addon name is uniformized for all these cases and
the add-on executed a second time.
Signed-off-by: Jose Martins <josemartins90@gmail.com>
2022-02-13 11:58:42 +01:00
Daniel Marjamäki
f2420509c9
Revert "constPointer: Fix false positives when pointer is not read"
...
This reverts commit 6427b4888b
.
If variable/parameter is unused it is better to warn about that.
2022-02-13 08:40:45 +01:00
Daniel Marjamäki
6427b4888b
constPointer: Fix false positives when pointer is not read
2022-02-12 22:23:25 +01:00
chrchr-github
0a99e3b6fc
Partial fix for #9407 FN redundant assignment/unreadVariable ( #3651 )
2022-02-12 15:32:08 +01:00
Daniel Marjamäki
30cec97cc8
Tokenizer: Support C++20 default bit-field member initializer
2022-02-12 12:19:08 +01:00
Oliver Stöneberg
06d10b7474
fixed and enabled performance-for-range-copy clang-tidy warning ( #3682 )
2022-02-12 08:20:45 +01:00
chrchr-github
edc5106237
Fix #9092 FN missingOverride - subclass in namespace ( #3793 )
2022-02-12 08:19:07 +01:00
chrchr-github
c5ab936088
Fix #10405 FN shadowVariable in range-based for loop ( #3789 )
2022-02-12 08:10:53 +01:00
Rikard Falkeborn
d4cd249c21
10671 fix const iterator function const take two ( #3802 )
...
* Revert "Revert "Fix #10671 : functionConst FN with begin/end and const_iterator (#3749 )""
This reverts commit 9f6a36c1a8
.
* Fix crash by adding missing null check
2022-02-11 21:23:23 +01:00
Oliver Stöneberg
6e57cc4323
small utils.h cleanup ( #3821 )
2022-02-11 19:44:08 +01:00
chrchr-github
5f3ddabd56
Fix FP constParameter with std::map ( #3823 )
2022-02-11 19:40:11 +01:00
Paul Fultz II
78228599da
Fix 10800: Hang / memory exhaustion on numerical code ( #3822 )
...
* Fix 10800: Hang / memory exhaustion on numerical code
* Format
* Add another test
* Format
2022-02-11 06:52:28 +01:00
Oliver Stöneberg
f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly ( #3767 )
2022-02-10 23:02:24 +01:00
Julien Marrec
2535bf984b
Allow passing std::string_view by value ( #3817 )
2022-02-10 21:01:12 +01:00
chrchr-github
cd7532df21
Fix #7709 FN C-style pointer casting with built-in or typedef types /… ( #3814 )
2022-02-10 20:48:51 +01:00
Paul Fultz II
5d25050b06
Fix 10788: False positive: zerodivcond when using an assert ( #3816 )
2022-02-10 20:22:14 +01:00
chrchr-github
24e9859158
Fix #10357 FP stlcstrParam due to incorrect overload resolution ( #3813 )
...
* Fix #10357 FP stlcstrParam due to incorrect overload resolution
* Variable shadowing
2022-02-10 11:17:06 +01:00
Paul Fultz II
a50452517d
Fix 10794: Crash in MultiValueFlowAnalyzer::getProgramState() ( #3815 )
...
* Fix 10794: Crash in MultiValueFlowAnalyzer::getProgramState()
* Format
2022-02-10 07:43:27 +01:00
chrchr-github
2c7948102a
Fix #10145 FP AssignmentAddressToInteger with enum class ( #3810 )
2022-02-08 16:12:35 +01:00
chrchr-github
e64ea20089
Fix #10527 FP variableScope for if with init-statement ( #3811 )
2022-02-08 16:12:09 +01:00
Paul Fultz II
20a5224d7e
Fix 10784: False positive: returnDanglingLifetime using std::tie with variadic template parameters ( #3805 )
2022-02-08 09:03:51 +01:00
Oliver Stöneberg
b5ed13c8bc
checkstl.cpp: removed unused global containers and made a std::string a literal so it can be matchcompiled ( #3801 )
2022-02-08 09:02:59 +01:00
Daniel Marjamäki
cfe2392709
ImportProject: Fix loading of sln without BOM
2022-02-08 08:52:39 +01:00
Paul Fultz II
260d155bb6
Fix 10785: False positive: constParameter when using member pointer ( #3807 )
2022-02-07 18:45:32 +01:00
Oliver Stöneberg
047930fd17
removed some unused/unread member variables (and related code) found by CLion "Unused global declaration" inspection ( #3808 )
2022-02-07 15:34:34 +01:00
Paul Fultz II
f2a419653c
Refactor ProgramMemory to store the expression tokens instead of exprIds ( #3798 )
2022-02-06 20:15:45 +01:00
Paul Fultz II
569332a50a
Fix 10786: False positive: arrayIndexOutOfBoundsCond ( #3803 )
2022-02-06 20:14:13 +01:00
Paul Fultz II
a639c59780
Fix 10787: False positive: knownConditionTrueFalse with a conditional exit ( #3804 )
2022-02-06 20:13:44 +01:00
Daniel Marjamäki
631a9eefd2
2.7: Set versions
2022-02-05 12:17:54 +01:00
Daniel Marjamäki
3989408738
Update copyright year
2022-02-05 11:45:17 +01:00
chrchr-github
7f28edbe26
Fix #10789 Crash in CheckMemoryLeakInClass ( #3797 )
2022-02-04 19:32:23 +01:00
chrchr-github
17b538210d
Fix #10151 FP eraseDereference when returning iterator from loop ( #3787 )
2022-02-03 21:13:48 +01:00
Daniel Marjamäki
9f6a36c1a8
Revert "Fix #10671 : functionConst FN with begin/end and const_iterator ( #3749 )"
...
This reverts commit 2cacb13f85
.
2022-02-03 11:04:02 +01:00
chrchr-github
a20465eaea
Fix #10484 FP knownConditionTrueFalse with static variable and direct initialization / partial fix for #10248 ( #3728 )
2022-02-02 22:30:49 +01:00
Daniel Marjamäki
4d9a1427b2
CheckClass: Write separate errorid for missing member copy instead of uninitMember
2022-02-02 20:44:22 +01:00
chrchr-github
511520d623
Fix #10679 FP constParameter with const/nonconst overload ( #3780 )
2022-02-02 19:38:32 +01:00
Rikard Falkeborn
2cacb13f85
Fix #10671 : functionConst FN with begin/end and const_iterator ( #3749 )
...
Check if the iterator is assigned to a const_iterator or
const_revese_iterator, in which case it is possible the function can be
const. Unfortunately, it is not possible to remove the hard coding of
cbegin, cend, crbegin and crend due to the need to handle auto, as in
the following code snippet:
void cbegin_auto(void)
{
for (auto it = m_str.cbegin(); it != m_str.cend(); ++it) {;}
}
2022-02-02 19:37:06 +01:00
chrchr-github
dad64bfcc8
Fix #10091 FP shadowFunction with default destructor implementation / Tests for #8635 , #9776 , #9940 , #9951 , #10018 ( #3763 )
2022-02-02 19:30:49 +01:00
chrchr-github
8cf5c8fbf2
Fix #10684 FP unusedStructMember with static object ( #3681 )
2022-02-02 19:28:16 +01:00
chrchr-github
94a1f76ec4
Fix 10158 FP memleak when pointer is stored in a sub-object ( #3764 )
2022-02-02 13:13:12 +01:00
Paul Fultz II
11387cbb41
Fix 10768: performance regression ( #3788 )
2022-02-02 13:01:44 +01:00
chrchr-github
2b13a27140
Fix #9696 FP uninitdata - writing pointer to stream ( #3772 )
2022-02-02 12:24:32 +01:00
shaneasd
4127885282
improve noConstructor message ( #3750 )
2022-02-01 17:24:26 +01:00
Oliver Stöneberg
8f7770f512
added an include-what-you-use GitHub Action ( #3759 )
2022-02-01 17:19:19 +01:00
chrchr-github
0807924d32
Fix FP passedByValue for unions / FN passedByValue for array members ( #3784 )
2022-02-01 17:17:08 +01:00
chrchr-github
127b3bb1c4
Fix #9471 FP unreadVariable caused by invalid template injection ( #3783 )
2022-02-01 17:15:27 +01:00
Daniel Marjamäki
637aca8d59
Fixed #10752 (False positive: shadow variable in static method)
2022-01-28 16:03:06 +01:00
Oliver Stöneberg
38420c8ecf
added some more missing copyright headers ( #3766 )
2022-01-28 15:56:11 +01:00
chrchr-github
d55010c441
Fix #9247 FP uninitMemberVar (inconclusive) ( #3765 )
2022-01-28 15:05:13 +01:00
chrchr-github
c74eeb6bad
Fix FN uninitVar with std::array ( #3707 )
2022-01-27 19:45:27 +01:00
chrchr-github
f429245da2
Fix #8557 FP format string requires unsigned long (for sizeof(var)) ( #3727 )
2022-01-27 19:43:52 +01:00
Oliver Stöneberg
171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use ( #3757 )
2022-01-27 19:03:20 +01:00
Oliver Stöneberg
a2a9c90142
added some missing copyright headers ( #3758 )
2022-01-26 19:02:20 +01:00
Paul Fultz II
40147c1e4b
Fix 10719: Crash in valueFlowIterators() ( #3756 )
...
* Fix 10719: Crash in valueFlowIterators()
* Format
2022-01-26 06:42:41 +01:00
Paul Fultz II
1a949c00b0
Fix 10723: Assertion 'tok && tok->exprId() > 0 && "Missing expr id for symbolic value"' in valueFlowSmartPointer() ( #3755 )
...
* Fix 10723: Assertion 'tok && tok->exprId() > 0 && "Missing expr id for symbolic value"' in valueFlowSmartPointer()
* Format
2022-01-26 06:28:13 +01:00
chrchr-github
f49cfcd23c
Fix #10200 False positive: uninitStructMember ( #3741 )
2022-01-25 12:14:20 +01:00
chrchr-github
ea81ce933e
Fix #10754 FP invalidFunctionArg with resize() ( #3737 )
2022-01-25 12:13:49 +01:00
chrchr-github
d05e43ce15
Fix #9828 False positive: unreadVariable alias ( #3744 )
2022-01-24 21:52:45 +01:00
chrchr-github
9d6e5c2a05
Fix #10237 uninitMemberVar - member initialized via function call ( #3745 )
2022-01-24 21:52:00 +01:00
chrchr-github
158f3d494e
Fix #10143 false positive: redundantInitialization with std::shared_ptr ( #3746 )
2022-01-24 21:50:50 +01:00
chrchr-github
d64dadcd31
Fix #10758 Crash in CheckClass::checkConstFunc() ( #3740 )
2022-01-24 21:50:01 +01:00
Oliver Stöneberg
8179226b18
astutils.cpp: optimized visitAstNodesGeneric() a bit more by avoiding unnecessary checks and std::stack usage ( #3732 )
2022-01-24 21:44:09 +01:00
Paul Fultz II
01e14a12f1
Fix 10755: Assertion "!maxValue->isKnown()" from valueFlowInferCondition ( #3739 )
...
* Fix 10755: Assertion "!maxValue->isKnown()" from valueFlowInferCondition
* Format
2022-01-22 12:25:20 +01:00
Paul Fultz II
8b1ed9cbe1
Another fix for 10739: internalAstError with decltype ( #3738 )
...
* Another fix for 10739: internalAstError with decltype
* Format
2022-01-22 07:22:57 +01:00
chrchr-github
b23ca879ed
Fix #10735 FP functionConst with overloaded operator[] [inconclusive] ( #3733 )
2022-01-21 20:40:10 +01:00
Paul Fultz II
a7dbd288c4
Fix 10738: FP knownEmptyContainer with auto reference ( #3734 )
...
* Fix 10738: FP knownEmptyContainer with auto reference
* Format
2022-01-21 09:56:55 +01:00
Paul Fultz II
6c2b1f093d
Another fix for 10728: Crash in CheckStl::checkDereferenceInvalidIterator2() ( #3735 )
...
* Another fix for 10728: Crash in CheckStl::checkDereferenceInvalidIterator2()
* Format
2022-01-21 09:56:41 +01:00
Paul Fultz II
0737cc4d8c
Fix 10708: Assertion "!maxValue->isKnown()" from valueFlowInferCondition ( #3736 )
...
* Fix 10708: Assertion "!maxValue->isKnown()" from valueFlowInferCondition
* Format
2022-01-21 09:56:24 +01:00
Paul Fultz II
57b50e4b00
Fix 10739: internalAstError with decltype ( #3723 )
2022-01-20 21:36:48 +01:00
Daniel Marjamäki
ebd1fbbfd8
cert: improved check for int31-c
2022-01-20 21:09:39 +01:00
chrchr-github
4d44d0c079
Fix #9781 FP deallocuse after auto_ptr ( #3724 )
2022-01-19 21:39:45 +01:00
Oliver Stöneberg
55ff684f34
added unusedFunction self check to CI / cleanups ( #3526 )
2022-01-18 22:02:25 +01:00
Rikard Falkeborn
e106654993
Fix #10729 : Uncaughty exception in CheckMemoryLeak::getReallocationType() ( #3717 )
2022-01-18 20:50:06 +01:00
chrchr-github
1e2863cd33
Fix #10520 FP functionConst with aggregate initialization [inconclusive] ( #3720 )
2022-01-18 20:49:35 +01:00
chrchr-github
ca2e0ca287
Fix FP functionConst with extra parentheses ( #3722 )
2022-01-18 20:21:25 +01:00