Commit Graph

622 Commits

Author SHA1 Message Date
chrchr-github 67b61a0ab7
Fix false negative: passedByValue () 2023-10-31 19:08:08 +01:00
chrchr-github 41bd28c0b3
Fix Library: add Container::Action::FIND_CONST () 2023-10-20 21:22:06 +02:00
chrchr-github f56677a99d
Fix FP constParameterReference with std::map () 2023-10-13 18:08:40 +02:00
Daniel Marjamäki cc44966fb5
std.cfg: remove wrong macro replacements for UINT32_C etc. ()
The replacements should be platform dependent.
2023-10-08 14:44:07 +02:00
orbitcowboy 1b3fa2af88
Added floating point categories to handle the return value from fpclassify() ()
Reference: https://en.cppreference.com/w/cpp/numeric/math/FP_categories
2023-10-01 23:51:06 +02:00
Oliver Stöneberg 5eb1750adb
moved some standard stuff from `avr.cfg` to `std.cfg` () 2023-09-13 10:44:01 +02:00
Anton Lindqvist 73b9442edd
Fix constParameterPointer regression ()
Commit 73251544a ("Fix  FN constParameterPointer with library
function ()") most likely introduced a regression for (C) function
pointers passed to functions provided by the standard library that
cppcheck has knowledge about.
2023-08-23 10:33:01 +02:00
chrchr-github 725c431ecc
Fix FP returnStdMoveLocal / Fix FP incorrectStringBooleanError / Support std::string::starts/ends_with() () 2023-08-21 10:43:54 +02:00
chrchr-github 73251544a4
Fix FN constParameterPointer with library function () 2023-08-05 18:48:43 +02:00
chrchr-github 709fec88f9
Revert "Fix FN: minsize not checked for string literal, buffer… ()
… access out of bounds not found ()"

This reverts commit 9ad18f51af.
2023-07-11 22:19:01 +02:00
chrchr-github 9ad18f51af
Fix FN: minsize not checked for string literal, buffer access out of bounds not found () 2023-07-08 14:46:32 +02:00
chrchr-github 6c750d9ae9
Fix FP knownConditionTrueFalse with std::vector::size() ()
There is special handling for `size_t` in
`ValueType::fromLibraryType()`, which gets preempted if it is also
configured as a podtype.
2023-06-23 20:31:25 +02:00
chrchr-github 8f6b0b41e7
Simplify qt.cfg, wxwidgets.cfg () 2023-06-17 17:04:14 +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-github 022fcb3be1 Handle const, noreturn, return type 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 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
chrchr-github ec4267a2bd
Don't suggest const for smartptr::get() ()
* Don't suggest const for smartptr::get()

* Fix test

* Fix merge

* get() doesn't change a smartpointer

* Parentheses
2023-06-07 20:45:48 +02:00
SChernykh 93595aeff0
Fixed `std::vector::data` return type ()
This caused many `arithOperationsOnVoidPointer` false positives in my project which uses `std::vector<uint8_t>` in many places.
2023-06-05 20:47:42 +02:00
chrchr-github f2976e5bb5
std.cfg: add support for smartptr member functions ()
* std.cfg: add support for smartptr member functions

* Fix test

* Fix
2023-06-03 14:36:30 +02:00
chrchr-github 7c56514bd5
Fix reopened Improve check: missing virtual destructor ()
* Fix  reopened Improve check: missing virtual destructor

* Add support for missing container members

* Add more stuff

* Improve qt.cfg

* Improve wxwidgets.cfg, qt.cfg
2023-06-02 15:24:18 +02:00
chrchr-github cf4334904c
Fix FN functionConst with non-dereferenceable pointer access ()
* Partial fix for  FN functionConst with non-dereferenceable pointer access

* Fix  FN functionConst with non-dereferenceable pointer access

* Fix test
2023-05-28 19:42:47 +02:00
Mateusz Michalak 2d5cabed4b
Add std::*begin and std::*end cfg () 2023-03-09 17:06:53 +01:00
chrchr-github 9291421840
Fix FN useStlAlgorithm with complex condition () 2023-03-04 11:58:12 +01:00
chrchr-github 491299048b
Amend fix for Function call not recognized () 2023-03-02 21:45:15 +01:00
chrchr-github 50c8a0dbe1
Fix pop_back on empty container is UB () 2023-02-24 01:10:19 +01:00
Oliver Stöneberg 8c527bf132
std.cfg: added support for more container methods ()
* std.cfg: added support for `std::unordered_map::count()`

* std.cfg: added support for `std::multimap::count()`

* std.cfg: added support for `std::unordered_map::insert()`

* std.cfg: added support for `std::unordered_set::insert()`

* std.cfg: added support for `std::unordered_set::emplace()`
2023-02-11 10:48:17 +01:00
chrchr-github 0dddba3bd6
Fix cfg for std::xstream::write() () 2023-02-08 08:59:13 +01:00
chrchr-github d8323c367e
std.cfg: use-retval for container member functions () 2023-02-06 22:03:23 +01:00
Mateusz 7ae7ad60d8
Added cfg information about std::span ()
* Added cfg information about std::span

* Add tests for span handling

* Add details about functions and tests fo std::span

* Add tests in dangingLifetimeContainerView for span

* Reduce c++ version from 20 to 2a

* Add checking if span is supported in std lib cfg checks
2023-02-05 18:10:08 +01:00
chrchr-github 7945b835e1
Add support for std::string_view::substr() () 2023-01-20 15:46:06 +01:00
chrchr-github f8f66aeea9
Improve std.cfg: std::addressof(), std::stringstream::str() ()
* Improve std.cfg: std::addressof(), std::stringstream::str()

* Format

* Add <leak-ignore/>
2023-01-16 22:08:31 +01:00
chrchr-github d5d7446433
Add cfg for std::scoped_lock, handle template arguments in checkMisusedScopedObject() () 2022-12-07 09:10:48 +01:00
chrchr-github 4d13266e99
Fix FN unusedScopedObject: temporary lock 'std::lock_guard<std::mutex>(m)' ()
* Fix  FN unusedScopedObject: temporary lock 'std::lock_guard<std::mutex>(m)'

* Format

* Fix cppcheck-cfg.rng

* Format
2022-09-30 07:25:33 +02:00
chrchr-github 6142ba542a
Fix leakNoVarFunctionCall FP () 2022-09-29 21:58:11 +02:00
Maksim Derbasov ff4eb586ea
std.cfg std exceptions added to unusedvars () 2022-09-26 20:08:48 +02:00
chrchr-github 48999cf1d1
Add support for std::ofstream::precision() ()
* Add support for std::copy_n/merge/stable_sort

* Format

* Add support for std::unordered_set::count(), std::push_heap

* Missing include

* Add support for std::iota

* Missing include

* Add support for std::ofstream::precision()

* Typo

* Typo
2022-09-20 17:23:18 +02:00
chrchr-github 2ce25abd81
Add support for std::iota ()
* Add support for std::copy_n/merge/stable_sort

* Format

* Add support for std::unordered_set::count(), std::push_heap

* Missing include

* Add support for std::iota

* Missing include
2022-09-20 07:30:24 +02:00
chrchr-github d6aab96734
Add support for std::unordered_set::count(), std::push_heap ()
* Add support for std::copy_n/merge/stable_sort

* Format

* Add support for std::unordered_set::count(), std::push_heap

* Missing include
2022-09-16 07:12:36 +02:00
chrchr-github 7111270d5f
Add support for std::copy_n/merge/stable_sort ()
* Add support for std::copy_n/merge/stable_sort

* Format
2022-09-15 19:56:45 +02:00
chrchr-github 1e14e360cb
Fix FN (error) Buffer is accessed out of bounds (wcpncpy, wcsncpy) ()
* Fix  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 71d386819e
Fix FP bufferAccessOutOfBounds is reported on strncmp() ()
* Add test

* Fix  FP bufferAccessOutOfBounds is reported on strncmp()

* Remove suppressions
2022-07-15 17:43:18 +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