Commit Graph

27571 Commits

Author SHA1 Message Date
Daniel Marjamäki aca6c47024
Fix (False positive: passing struct pointer to function that initialize it) () 2023-06-16 18:43:32 +02:00
chrchr b41f9af2c5 Fix FP autovarInvalidDeallocation 2023-06-16 17:21:37 +02:00
PeterSchops b689ca8d89
Update cppcheckdata.py ()
* Update cppcheckdata.py

- added links to cpp-file/function that writes this part of the dump-file 
- updated documentation (Added list of possible return values for a number of variables) 
- added MacroUsage isKnownValue 
- added ValueType reference 
- added Token isBoolean 
- added Token isCast 
- added Token externLang 
- added Token isComplex 
- added Token isRestrict 
- added Token isAttributeExport 
- added Token originalName 
- added Scope functions 
- added Scope definedType 
- added Function hasVirtualSpecifier 
- removed Function isVirtual 
- added Function isAttributeNoreturn 
- added Function overriddenFunction 
- added Variable isVolatile 
- class Container added 
- added Value movedValue 
- added Value uninit 
- added Value bufferSize 
- removed Value inconclusive and added it to valueKind

* Update cppcheckdata.py

removed encoding from open (needed to make python 2.7 check pass) where python 2.7 should not be used anymore

* Update cppcheckdata.py after feedback

made sure that attributes I added to the class always have a value
added some missing attributes in the print
2023-06-15 20:42:58 +02:00
Daniel Marjamäki b462d070bf Minor tweaking of constness 2023-06-15 19:41:47 +02:00
chrchr c02a9f403a Fix tests 2023-06-15 19:22:19 +02:00
chrchr 39d60ca63e Add test 2023-06-15 18:53:42 +02:00
chrchr 19d4ab7d31 Fix test 2023-06-15 18:52:52 +02:00
chrchr 9579b4509d Partial fix for cppcheckError with unknown macro 2023-06-15 18:36:21 +02:00
Daniel Marjamäki f934d6e5d0
Fix (False positive: uninitialized member after assignment) () 2023-06-15 14:42:58 +02:00
Daniel Marjamäki d75331d00d
Fix (FP ctuOneDefinitionRuleViolation for template specialization) () 2023-06-15 11:43:07 +02:00
Long Radix c033c62190
Typos and stilistic updates () 2023-06-14 12:30:45 +02:00
Daniel Marjamäki 9339802be3
Fix (FP syntaxError from switch in C code) () 2023-06-14 10:41:37 +02:00
chrchr-github 457e0ce0c8 Partial fix for checkLibraryNoReturn with std::function parameter 2023-06-13 21:48:16 +02:00
chrchr 0afc5aba78 Fix checkLibraryFunction/NoReturn when inheriting from container 2023-06-13 15:04:25 +02:00
chrchr fad1f6b559 Fix AST regression 2023-06-13 14:32:31 +02:00
chrchr-github 6f56a9563e
Add missing rebinding trait to TaggedAllocator (complete ) () 2023-06-13 11:22:43 +02:00
Anton Lindqvist 09cd3a8269
Fix FP deallocuse regression ()
Introduced in commit 69116c838 ("Fix  Regression: memleak / Fix  FN:
deallocuse ()").
2023-06-11 14:11:41 +02:00
Daniel Marjamäki f6a65afdee
Fix FP uninitStructMember when other variable is only nonzero if struct member is initialized () 2023-06-10 21:35:17 +02:00
Daniel Marjamäki 7840bc4c63 Execute runformat 2023-06-10 17:37:32 +02:00
chrchr-github 24b0d08753
Fix FP autoVariables ()
* Fix  FP autoVariables when reassigning argv

* Fix  FN autoVariables with array and std::string

* Add test

* Format

* Format

* Simplify check, fix inconclusive

* Fix merge, add test

* Fix FPs

* Format

* Format

* Undo move

* Format
2023-06-10 16:28:29 +02:00
Daniel Marjamäki 1c28457d2c
ValueFlow: Fix uninitvar false positive after initialization '*((int*)&x) = ..' () 2023-06-10 15:22:17 +02:00
Daniel Marjamäki 3c8caac772
Fix (FP uninitvar in for loop iteration expression) () 2023-06-10 09:58:08 +02:00
chrchr-github 7e0f64688f
Fix internalAstError on C++20 templated lambda / Fix internalAstError on nested lambda ()
* Fix  internalAstError on C++20 templated lambda

* Fix  internalAstError on nested lambda passed as argument
2023-06-10 07:42:10 +02:00
chrchr-github d4705ca8ab
Fix cppcheckError Cyclic reverse analysis ()
* Fix  cppcheckError Cyclic reverse analysis

* Handle fixed AST in ValueFlow, fix FN

* Remove
2023-06-10 07:41:52 +02:00
chrchr-github 69116c8386
Fix Regression: memleak / Fix FN: deallocuse ()
* Fix  Regression: memleak

* Format

* Fix  FN: deallocuse

* Complete the trifecta
2023-06-10 00:24:36 +02:00
Daniel Marjamäki 22e67d3534
Fixed (AST: wrong ast of ({}) in struct initialization) () 2023-06-09 22:31:14 +02:00
orbitcowboy 6ea88c2758
Added test case from ()
* Added test case from  and a TODO

* Check with in C++ mode to get rid of TODO.

* Updated expected error message text

* Updated expected error message text
2023-06-09 21:46:45 +02:00
chrchr f5c61bebef Simplify 2023-06-09 18:21:26 +02:00
Daniel Marjamäki a62fedc641
GUI: Do not use --rule-texts in cppcheck premium () 2023-06-09 17:15:48 +02:00
chrchr-github 2da453fdc9 Update library.cpp 2023-06-09 16:53:23 +02:00
chrchr-github 127a66d291 Move to size category 2023-06-09 16:53:23 +02:00
chrchr e5616c7c00 Undo 2023-06-09 16:53:23 +02:00
chrchr 006a323caa Format 2023-06-09 16:53:23 +02:00
chrchr f17f03befa C++11 sucks 2023-06-09 16:53:23 +02:00
chrchr 55a279fade Fix compilation 2023-06-09 16:53:23 +02:00
chrchr 68a59830a4 Fix returnValueType() 2023-06-09 16:53:23 +02:00
chrchr 55f34e2681 Extend XML schema 2023-06-09 16:53:23 +02:00
chrchr-github 022fcb3be1 Handle const, noreturn, return type 2023-06-09 16:53:23 +02:00
chrchr-github 220ad27fa8 Add Yield::ITERATOR 2023-06-09 16:53:23 +02:00
chrchr-github c609ef8814 Add Yield::AT_INDEX 2023-06-09 16:53:23 +02:00
chrchr-github ac87c1174c Revert "Remove redundant functions"
This reverts commit 4f124a57de5c761ac757ebed83d9f047ef4a1328.
2023-06-09 16:53:23 +02:00
chrchr-github 3f0999b015 Remove redundant functions 2023-06-09 16:53:23 +02:00
chrchr-github 605ff520b9 Add Yield::BUFFER 2023-06-09 16:53:23 +02:00
chrchr-github e798e72252 Handle combined action/yield 2023-06-09 16:53:22 +02:00
chrchr-github bd6c5318ad
Detect container action and yield functions ()
* Detect container action and yield functions

* Fix test

* Adapt getUseRetValType() to handle container yield functions
Add TODO

* Handle combined action/yield

* Add Yield::BUFFER

* Remove redundant functions

* Revert "Remove redundant functions"

This reverts commit 4f124a57de5c761ac757ebed83d9f047ef4a1328.

* Add Yield::AT_INDEX

* Add Yield::ITERATOR

* Simplify
2023-06-09 16:03:47 +02:00
Daniel Marjamäki 2beb46194f philosphy.md: Remove section about bughunting it has been moved to Cppcheck Premium 2023-06-09 09:40:58 +02:00
Daniel Marjamäki b086873599
Cppcheck: change severity from information to error for internalError () 2023-06-08 23:31:36 +02:00
Daniel Marjamäki 3630ba9a3d AUTHORS: add carlatcrown 2023-06-08 20:05:09 +02:00
Carl Morgan 6741f774b1
Support integer Z suffix and user defined literals with _ suffix (, ) ()
Co-authored-by: Carl Morgan <no-reply@crown.com>
2023-06-08 20:03:41 +02:00
Daniel Marjamäki d4902109cd
threadsafety.py: cleanup () 2023-06-08 19:58:11 +02:00