Commit Graph

38 Commits

Author SHA1 Message Date
Oliver Stöneberg bfb50ca9d8
removed unnecessary `Settings` parameter from `Check::runChecks()` and made `Tokenizer` a reference (#5308)
There was no need for the `Tokenizer` parameter to be a pointer as it
could never be `nullptr` and was also dereferenced without checking
first.

As a reference to the `Settings` was already available via the
`Tokenizer` there was no need to pass it separately. In the production
code there will only be one instance of it but in the tests we could
have accidentally passed a different one.
2023-08-18 12:03:50 +02:00
Daniel Marjamäki 464fbe8d53 Update copyright year 2023-01-28 10:16:34 +01:00
Oliver Stöneberg a09667a6d9
removed unused error messages (#4689) 2023-01-07 10:35:39 +01:00
Daniel Marjamäki 1f6554e2e8 Update copyright year 2022-05-21 12:18:27 +02:00
Oliver Stöneberg f32583e097
removed OVERRIDE and FINAL defines and use the keywords directly (#3767) 2022-02-10 23:02:24 +01:00
Daniel Marjamäki 08f9de95e2 Update copyright year 2021-09-26 11:34:56 +02:00
Paul Fultz II 7f358b2bed
Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
Rikard Falkeborn 295153df72 Checkstring fixes (#1783)
* teststring.cpp: Fix ternary syntax in tests

* stringLiteralWrite: Add tests wide character and utf16 strings

* suspiciousStringCompare: Add test with wide character string

* strPlusChar: Handle wide characters

* incorrectStringCompare: Add test with wide string

* Suspicious string compare: suggest wcscmp for wide strings

* deadStrcmp: Extend to handle wide strings

* sprintfOverlappingData: Print name of strcmp function

* Conversion of char literal to boolean, add wide character tests

* Conversion of char literal to boolean, fix ternary
2019-04-06 06:54:38 +02:00
Daniel Marjamäki 3dc34f1515 Disable all simplified checks 2019-03-16 09:17:50 +01:00
Daniel Marjamäki ef6fc67da4 Move CheckString::checkAlwaysTrueOrFalseStringCompare() from runSimplifiedChecks() to runChecks() 2019-02-25 18:11:33 +01:00
Daniel Marjamäki f1146e398a Moved CheckString::sprintfOverlappingData from runSimplifiedChecks to runChecks 2019-02-25 09:23:03 +01:00
Daniel Marjamäki 4218698fb1 Moved CheckString::checkIncorrectStringCompare from runSimplifiedChecks to runChecks 2019-02-25 09:08:16 +01:00
Daniel Marjamäki bd7790fd8c Update copyright year 2019-02-09 07:24:06 +01:00
Daniel Marjamäki 8b5f36670a Introduce macro OVERRIDE for gcc-4.6 compatibility. 2019-01-12 07:37:42 +01:00
Daniel Marjamäki 936c627307 Fix --doc output. * must be escaped. 2018-10-11 13:59:21 +02:00
Daniel Marjamäki 77b653bf94 Clarify warnings when char literals are converted to bool in conditions 2018-07-21 18:40:06 +02:00
IOBYTE ce50df8047 Fix override warnings. (#1234) 2018-05-15 16:37:40 +02:00
Daniel Marjamäki 7e4dba6a7e Updated copyright year 2018-03-31 20:59:09 +02:00
Daniel Marjamäki a0a04be011 Fix Cppcheck warning about mismatching argument names 2018-01-15 22:25:55 +01:00
Daniel Marjamäki c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
Daniel Marjamäki d292434e76 Try again to clarify warning message for new strcmp() checker 2017-12-13 15:28:50 +01:00
Daniel Marjamäki 3f36d4b5f4 try to clarify error message 2017-12-11 22:10:00 +01:00
Daniel Marjamäki 6c50dafbac Fix classInfo to fix TestCppcheck assertion 2017-11-27 23:34:01 +01:00
Daniel Marjamäki f28d5e91ac Fixed #8251 (Condition: bug when there are more than 2 strcmp() on same buffer (tricky)) 2017-11-27 12:55:20 +01:00
Ayaz Salikhov b8cd7dbb5c Use nullptr instead of 0 or NULL (#936) 2017-08-09 20:00:26 +02:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
PKEuS 644a216394 Fixed two false positives related to char arrays initialized by a literal:
- Run check for writing to string literals on non-simplified token list (#7283)
- Run buffer overrun checking for string literals on non-simplified token list (https://sourceforge.net/p/cppcheck/discussion/general/thread/2c33dfc5/)
2016-07-07 19:38:15 +02:00
amai2012 eba1b0881d Minor refactoring: use nullptr (instead of 0/NULL), change signature of Tokenizer::createTokens 2016-05-07 16:30:54 +02:00
Lauri Nurmi 996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
Daniel Marjamäki 0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
Daniel Marjamäki e36cc9f6d9 stringLiteralWrite: Updated error message 2015-06-05 14:34:13 +02:00
Daniel Marjamäki 71cb8e9f64 Fixed --errorlist output for new checker stringLiteralWrite 2015-05-03 15:02:34 +02:00
Daniel Marjamäki 9d31afb663 Fixed #1748 (Undefined Behavior: Modification of string literal) 2015-05-03 10:44:40 +02:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
Daniel Marjamäki 051d42ae6b astyle formatting 2014-11-20 14:20:09 +01:00
orbitcowboy f5d804f71a running astyle 2014-11-20 10:13:03 +01:00
Daniel Marjamäki fbc6323a9b doc: changed --doc output to Markdown syntax 2014-09-30 14:56:12 +02:00
PKEuS eba8c6f6c5 Refactorization:
- Added missing separating comments between checks in checkother.cpp
- Moved checks related to strings into own file
2014-08-27 09:42:09 +02:00