Commit Graph

116 Commits

Author SHA1 Message Date
chrchr-github 2379239aed
Fix FP ignoredReturnValue () 2023-02-11 10:46:04 +01:00
chrchr-github 132ae52428
Don't show checkLibraryFunction warning for types with unusedvar configuration () 2023-02-07 21:58:44 +01:00
chrchr-github 8af1026696
Set functions for calls through iterators () 2023-02-07 21:57:59 +01:00
chrchr-github e8c3a80678
Improve --check-library error message () 2023-02-01 14:53:57 +01:00
Oliver Stöneberg 7c7ccdf7c0
Check: disallow more than one instance per check () 2023-01-29 17:23:03 +01:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg 1d3955bd92
renamed some files in the `test` folder () 2023-01-27 08:18:32 +01:00
Oliver Stöneberg fd15811215
de-coupled `--check-library` from `information` severity and other dependencies () 2023-01-26 22:28:04 +01:00
chrchr-github 617cd29a41
Get type from auto () 2022-12-18 16:54:58 +01:00
chrchr-github 8713dabe58
Get type from iterator () 2022-12-07 09:38:36 +01:00
chrchr-github 0854fda28a
Get type from smartpointer ()
* Fix  checkLibraryFunction treats "auto" as type

* Use utility function

* Get type from 'auto p = new ...'

* Fix merge

* Add test for recent fix

* Format

* Get type from smartpointer
2022-12-03 07:50:21 +01:00
chrchr-github e4ee7cd59c
Get type from 'auto p = new ...' ()
* Fix  checkLibraryFunction treats "auto" as type

* Use utility function

* Get type from 'auto p = new ...'

* Fix merge
2022-12-02 20:28:14 +01:00
chrchr-github 9efedd6be9
Fix checkLibraryFunction treats "auto" as type ()
* Fix  checkLibraryFunction treats "auto" as type

* Use utility function
2022-12-02 07:21:33 +01:00
Razvan Ioan Alexe 1da37461e3
Typo found in Summary of CWE: 758 () 2022-10-20 19:11:15 +02:00
chrchr-github 33fde8ae6b
Add tests for , ()
* Add test for , avoid duplicate warning

* Add test for 

* Fix test

* Merge

* Add test for 

* Fix  checkLibraryCheckType with asm goto() (invalid varid)

* Format

* Add tests for , 

* Fix test

* Add test for 

* Add tests for , 
2022-09-29 12:33:34 +02:00
Paul Fultz II fc39a4d1bb
Fix 11171: False positive: missing return statement when std::enable_if_t is used ()
* 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
chrchr-github f274d499a1
Fix FP missing return statement when std::enable_if_t is used ()
* Fix  FP missing return statement when std::enable_if_t is used

* Add check
2022-09-19 12:47:58 +02:00
Oliver Stöneberg b3ec225480
iwyu.yml: use `debian:unstable` to always get latest include-what-you-use / cleaned up includes ()
* 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
Maksim Derbasov f93b588603
New check: use memcpy/memset instead of loop () 2022-09-03 23:29:06 +02:00
chrchr-github cf52ee098a
Fix checkLibraryFunction FPs ()
* Fix checkLibraryFunction FPs

* Fix FP with fclose()

* Format

* Fix FP with reinterpret_cast
2022-09-02 07:51:10 +02:00
Oliver Stöneberg 1b4141cbe5
added more missing `sstream` includes () 2022-08-19 18:23:15 +02:00
chrchr-github c878285a42
Add tests for , , , () 2022-07-30 16:15:32 +02:00
chrchr-github b16d12b5fb
Improve check for wchar_t () 2022-07-16 23:46:10 +02:00
chrchr-github 49117f5aeb
Fix static_assert shouldn't be reported by --check-library ()
* No need to check smart pointers, since they take template arguments

* Fix  static_assert shouldn't be reported by --check-library
2022-07-13 21:08:43 +02:00
Oliver Stöneberg 22be5f29aa
fixed (checkLibraryFunction with parameter to "std::string()") / added rudimentary tests for `CheckFunctions::checkLibraryMatchFunctions()` / added test for () 2022-07-12 17:39:01 +02:00
chrchr-github 8fc75402a1
Fix FP invalidFunctionArgStr () 2022-07-11 22:58:19 +02:00
chrchr-github 27578e9c4c
Fix FP returnStdMoveLocal () 2022-06-30 13:50:31 +02:00
chrchr-github 0d4b4394bb
Fix FP with embedded zeros ()
* Partial fix for  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 ()
* Partial fix for  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 FN: invalidFunctionArgStr printf argument ()
* Partial fix for  FN: invalidFunctionArgStr printf argument

* Typo

* Remove <strz>, suppressions

* Add suppresion, remove <strz>

* Add suppressions
2022-06-20 20:02:22 +02:00
PKEuS 82af702c6f
LCppC backport: Restored Check: Detect negative VLA and allocation (new[]) sizes () 2022-06-11 09:55:38 +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
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
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 67795cdfcf
Fixed FPs from Ticket 11119 - invalidFunctionArgStr with null-terminated strings ()
* Fixed first FP from  - invalidFunctionArgStr with null-terminated strings

* Fixed second test case from .

* 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 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
orbitcowboy 06216b06fc Fixed failing CI. 2022-05-15 08:53:21 +02:00
amai2012 a143fa37dd
use-retval for localtime() ()
* use-retval for localtime()

* Adjust test to avoid new warning
2022-03-25 17:32:54 +01:00
chrchr-github 6488cb6e76
Add test for () 2022-02-16 16:43:06 +01:00
Oliver Stöneberg f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly () 2022-02-10 23:02:24 +01:00
Daniel Marjamäki 3989408738 Update copyright year 2022-02-05 11:45:17 +01:00
Oliver Stöneberg 171da2e6f9
avoid dependency on transitive includes - based on include-what-you-use () 2022-01-27 19:03:20 +01:00
chrchr-github ea81ce933e
Fix FP invalidFunctionArg with resize() () 2022-01-25 12:13:49 +01:00
chrchr-github ca311ebcdf
ASSERT() on calls to Tokenizer::tokenize() in test code () 2021-11-29 07:34:39 +01:00
chrchr-github 80578c3504
Add test for () 2021-11-17 19:29:21 +01:00
Daniel Marjamäki 3e6540c4b3 Fixed (FP: missingReturn with nested switch statements) 2021-10-31 14:48:29 +01:00
Daniel Marjamäki 47f5e5d145 Fixed (FP missingReturn with empty initializer list) 2021-09-06 21:20:19 +02:00