Commit Graph

313 Commits

Author SHA1 Message Date
PKEuS 2f6350a0d0 Refactorized Library 2016-12-06 14:09:28 +01:00
Stefan Weil 57b57428c2 Fix some typos in comments (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2016-11-27 11:40:42 +01:00
Frank Zingsheim d4f01583b6 Fixed TODO (check if function parameter is non-const reference etc..) by common function 2016-11-01 14:06:30 +01:00
Daniel Marjamäki efa3aba32a Remove Tokenizer::simplifyNull() 2016-10-18 21:44:02 +02:00
Daniel Marjamäki af5dd2c29e New check: Pointer overflow (null pointer subtracted) 2016-10-09 15:15:29 +02:00
Daniel Marjamäki ed4a47de45 Tokenizer: Improve syntax checking of switch,if,while 2016-07-22 16:54:24 +02:00
PKEuS 923f7f843d Better distinguishing between possible and known null pointer dereferenciations (#7157) 2016-01-30 20:43:40 +01:00
Daniel Marjamäki 4a3ece5847 CheckNullPointer: Fix FP for 'buf[p]' when p is NULL 2016-01-20 08:42:58 +01: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
PKEuS 3a5cef8a7e Refactorization: Improved usage of Settings instances in test suite 2015-10-07 18:40:03 +02:00
Frank Zingsheim 1fd9ba0cc4 Fixed #6988 (incorrect nullPointer error for string) 2015-09-13 10:53:05 +02:00
Daniel Marjamäki 871b02ea88 removed testcase for #5238. it's not good enough. 2015-08-15 07:38:56 +02:00
Martin Ettl 84486605ec #6392: Added a regression test case. 2015-08-15 01:00:36 +02:00
Martin Ettl 278808daa9 #5238: Added a regression test case. 2015-08-15 00:49:07 +02:00
Martin Ettl 640ec3a099 #6491: Added a regression test. 2015-08-15 00:31:26 +02:00
Alexander Mai 0b96b9d984 #6505 ValueFlow: handle 2 related if in valueFlowSubFunction. Regression test. Bug got fixed before 2015-07-31 21:15:43 +02:00
Daniel Marjamäki 6790d91fbb Improve error messages for conditional values. make valueFlowSwitchVariable values conditional that depend on the case. Partial fix for #6884. 2015-07-29 19:54:57 +02:00
PKEuS 176b3925b3 Removed "verify" code in testrunner. Fixing its messages reduces the accuracy of the test suite. 2015-07-25 14:18:41 +02:00
Daniel Marjamäki eb0db322eb Fixed #6560 (ValueFlow: handling ternary operator better in valueFlowSubFunction) 2015-05-24 17:02:00 +02:00
Daniel Marjamäki bdc024bd7c Fixed 6634 (false positive: dereferencing null pointer in a sizeof operation) 2015-04-20 13:46:02 +02:00
Robert Reif 4ceb24630d Fixed #6568: Scope for template class member function missing in symboldatabase 2015-04-09 21:01:47 +02:00
Daniel Marjamäki fd6bd97972 Fixed #6495 (Improve check: uninitialized variable, 3rd function argument) 2015-03-14 19:23:33 +01:00
PKEuS bc5132e0ac Refactorization: Moved declaration of errout, ... to testsuite.h, uniformized style 2015-03-11 22:54:43 +01:00
PKEuS 451a277b18 Refactorization: Support function default values in ValueFlow, removed now obsolete CheckNullPointer::nullPointerDefaultArgument().
-> Use valueFlowForward() to parse values passed to functions
-> valueFlowForward(): Set value in first occurrence of a variable in a condition
2015-02-01 15:15:00 +01:00
PKEuS 21cb0cfd60 Take simplifyIfNotNull and simplifyIfNot out of simplifyTokenList1 (first step for #6072) 2015-01-31 20:12:02 +01:00
Daniel Marjamäki 8d2f271921 clean up cfg tests in TestNullPointer 2015-01-30 06:51:03 +01:00
Daniel Marjamäki 9bbad1b622 TestNullPointer: Moved posix.cfg tests 2015-01-30 06:43:40 +01:00
Daniel Marjamäki 0949baac9b TestNullPointer: moved out std.cfg checking 2015-01-29 06:07:48 +01:00
Daniel Marjamäki 70a38b1da6 TestNullPointer: Moved some std.cfg tests to the cfg testing 2015-01-28 16:22:45 +01:00
PKEuS 3274a00b82 Moved some more tests to testgarbage.cpp 2015-01-21 10:04:46 +01:00
Daniel Marjamäki fe8d04e840 CheckNullPointer: Fix FP when x is NULL and address is calculated with expression '&x->y.z[0]' 2015-01-05 14:54:24 +01:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
PKEuS c4fd8919a2 Fixed #6014: Added plausibility check before issuing null pointer messages on function calls defined in library 2015-01-02 13:35:39 +01:00
orbitcowboy def3491829 posix.cfg: Added support for readdir(). 2014-12-10 17:44:21 +01:00
Alexander Mai d11eb4931a #6306 false positive with strxfrm NULL argument. Adjust std.cfg in favor of no false positive 2014-12-07 15:24:27 +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
PKEuS b724784f0b Removed obsolete comments 2014-10-18 11:18:07 +02:00
PKEuS a99fd364ef Restored functionality to detect std::string(0) calls as null pointer dereferences (#6189) 2014-10-16 19:12:02 +02:00
Alexander Mai 21c85118d6 #6189 assign with operator= a '\0' to a std::string is not an error 2014-09-26 20:40:44 +02:00
Daniel Marjamäki ee93d30d94 ValueFlow: improved valueflow for loops that assign variable and then break 2014-09-23 16:06:02 +02:00
Alexander Mai 98d4c944e3 #6163 False nullPointer for strtok(NULL, ...). Correct std.cfg 2014-09-15 20:57:34 +02:00
Dmitry-Me 1e298a31cf Refactoring tests. Use utility function to warn about unsimplified code in tests. 2014-09-13 12:59:32 +02:00
Daniel Marjamäki 05617d7285 Fixed #6118 (False positive: divide by zero - if condition not evaluated properly) 2014-09-04 17:52:14 +02:00
PKEuS 4e9b145727 Added unit test for #3392 2014-09-02 12:03:05 +02:00
Alexander Mai 3aeecb8a05 #6100 False positive nullPointer - calling mbstowcs(NULL,). wcstombs has also been fixed 2014-08-27 19:32:53 +02:00
orbitcowboy 95c49ec5dc Extended std.cfg about more missing functions. Moved POSIX functions to posix.cfg. Extended posix.cfg about more memory allocating functions. 2014-06-25 12:00:24 +02:00
orbitcowboy f57e875351 Astyle run; Extended std.cfg and avr.cfg about a few more functions. 2014-06-23 11:59:14 +02:00
Daniel Marjamäki f78cbda2db Refactoring: Removed CheckNullPointer::nullPointerByCheckAndDeRef and implemented needed analysis in ValueFlow instead. 2014-06-22 10:02:14 +02:00
Daniel Marjamäki ef81bc363a ValueFlow: analysis in condition. 2014-06-19 17:29:41 +02:00
PKEuS 9dd4ac68c0 Refactorization in CheckNullPointer:
- Use AST to detect dereferences
- Added more unit tests
- Removed handling of unknown constructs in CheckNullPointer::isPointerDeRef()

Added link to verbose message cstyleCast.
2014-05-22 19:48:00 +02:00
Alexander Mai 91e7116de1 Fix regression from first attempt fixing #5811 (9dce9bddcb) 2014-05-17 19:14:29 +02:00
Alexander Mai 9dce9bddcb #5811 false postive: (error) Null pointer dereference 2014-05-17 18:18:20 +02:00
Daniel Marjamäki e04351ec33 re-enable tests in testnullpointer 2014-05-17 16:44:44 +02:00
Martin Ettl b363d0641a posix.cfg: Fixed FP for getcwd().First and second parameter is allowed to be zero. 2014-05-02 04:56:12 +02:00
Daniel Marjamäki 7317785e32 astyle formatting
[ci skip]
2014-04-27 10:20:21 +02:00
Alexander Mai 0b8dcbb441 Fix compiler warning about dead code due to disabled tests 2014-04-27 09:48:21 +02:00
Martin Ettl ed54b93317 Fixed FP in posix.cfg and mkdir() for second parameter. 2014-04-18 21:46:32 +02:00
orbitcowboy 66329fe8b8 posix.cfg: Fixed FP for isatty() function and added unit cases. 2014-04-10 17:53:04 +02:00
orbitcowboy baf8d09a0d Fixed FP for nullpointer dereference when using putchar. 2014-04-09 17:02:17 +02:00
orbitcowboy dd61c5db47 Fixed FP, nullpointer for memchr. 2014-04-08 18:39:50 +02:00
Alexander Mai a06371e063 Fixes for Doxygen + code formatting 2014-04-07 20:39:19 +02:00
unknown 9ae59290dd #5645 False positive Null pointer derefence about first argument to fputc() 2014-04-07 12:08:34 +02:00
Daniel Marjamäki a6557f8c74 Null pointer: Fixed false positive discovered by Travis when self-checking cppcheck 2014-04-02 19:39:42 +02:00
PKEuS 3950a62ef2 Added unit test for #2626 2014-03-28 10:06:24 +01:00
PKEuS 825b8b7c66 Unit test for #3589 2014-03-27 19:16:30 +01:00
PKEuS 7e4081f7f5 Treat syntaxError and cppcheckError as InternalErrors (throw as exception, #4268) 2014-03-27 13:15:21 +01:00
PKEuS 1677e2913e Regression test for #5061. 2014-03-26 12:17:27 +01:00
PKEuS 9b4b90f6a0 Avoid loading libraries multiple times in test suite
-> Massive speedup for test suite (especially on slow systems)
2014-03-24 09:59:05 +01:00
Martin Ettl e00f50b850 Fixed #5597 and added abort() support to stdcfg. 2014-03-21 17:36:48 +01:00
orbitcowboy 6507824a34 Added support for putchar() to std.cfg. 2014-03-20 05:49:38 +01:00
orbitcowboy 80e3b49cfc Added support for ftell() and puts() to std.cfg. 2014-03-20 04:10:41 +01:00
orbitcowboy 30006cf06f Added support for fputs() to std.cfg. 2014-03-20 02:13:41 +01:00
orbitcowboy b37e9601c1 Added support for fgetc() to std.cfg. 2014-03-20 00:59:52 +01:00
Martin Ettl fe1b46c174 Extended std.cfg 2014-03-19 21:08:48 +01:00
PKEuS 86e6bb430a New check: Warning, if positioning operation (fseek) is performed on a file opened in "a" mode 2014-03-17 11:02:03 +01:00
Martin Ettl 80b1271d01 Astyle running and added test cases for functions in std.cfg. 2014-03-10 02:21:44 +01:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
Daniel Marjamäki b8b573321e CheckNullPointer: Update std.cfg and test that updates are correct 2014-01-27 17:33:16 +01:00
Daniel Marjamäki 87b67e9b77 TestNullPointer: Added test configuration for 'memcmp' that is needed by a test 2014-01-26 16:32:28 +01:00
Daniel Marjamäki 1d7bb05faf Remove ExecutionPath from CheckNullPointer 2014-01-22 20:24:51 +01:00
Daniel Marjamäki f3f7e6d302 value flow: replacing executionpath checking of null pointers 2014-01-22 20:16:31 +01:00
Daniel Marjamäki 43db1ee797 value flow: use more specific bailouts when analysing value flow after assignment 2014-01-22 06:38:25 +01:00
Daniel Marjamäki cc38dec3ad value flow: a bit better handling of assigned variable 2014-01-22 06:10:17 +01:00
Daniel Marjamäki a27ccbd0f8 value flow: start implementing value flow analysis of assigned value 2014-01-21 21:13:49 +01:00
Daniel Marjamäki 30cae358d8 Removed the --value-flow flag. ValueFlow analysis will always be enabled from now on. 2014-01-17 18:07:05 +01:00
Daniel Marjamäki c9e9262682 value flow: use checknullpointer checking based on new value flow analysis in the TestNullPointer 2014-01-12 19:51:05 +01:00
Daniel Marjamäki 5d2a39b580 CheckNullPointer: improved function call checking when new value flow analysis is used 2014-01-12 19:27:26 +01:00
Daniel Marjamäki bef56d7a70 reverted change I pushed by mistake 2014-01-12 15:44:40 +01:00
Daniel Marjamäki 424675982a dmake: use -std=c++0x instead of -std=c++11 as it's supported by earlier gcc 2014-01-12 15:38:51 +01:00
Daniel Marjamäki 7c4a7ac3d5 value flow: starting to refactor CheckNullPointer::nullPointerDeRefThenCheck 2014-01-08 17:37:39 +01:00
Daniel Marjamäki 7125682d1a Fixed #5274 (TokenList: macro handling) 2014-01-03 18:53:37 +01:00
PKEuS 4f0121ee2f Splitted simplification out of tokenize() 2013-12-30 17:45:28 +01:00
Daniel Marjamäki 872b6e8fcc Fixed VS compiler warning. Using 'struct' for class. Thanks XhmikosR for reporting. 2013-12-26 17:48:25 +01:00
Daniel Marjamäki 20b84fcdee Null pointers: Don't warn when first argument to freopen() is NULL 2013-11-08 13:22:07 +01:00
Daniel Marjamäki 7996d609be Fixed #5108 (false positive: uninitialized variable (assignment in function parameter)) 2013-11-04 23:09:15 +01:00
Daniel Marjamäki 5f0cfa0ee4 Fixed #4983 (False positive warning 'Possible null pointer dereference: lblList - otherwise it is redundant to check it against null.' with sizeof lblList[0]) 2013-11-02 23:56:10 +01:00
Daniel Marjamäki 4a6274dcc0 Merge pull request #183 from felipensp/null_ptr_typeof
- Fixed false positive when passing pointer to typeof()
2013-10-27 02:37:31 -07:00
Daniel Marjamäki fd0f2d7900 Fixed #4929 (False positive: possible null pointer deref (checks dont handle && and || well)) 2013-10-22 10:47:48 +02:00