Commit Graph

857 Commits

Author SHA1 Message Date
PKEuS 22fbc18fb7 Fixed false positive for *a++ in for-loop condition
Moved unit test to testgarbage.cpp
2015-05-07 20:34:57 +02:00
Dmitry-Me 818346622c More tests for checking negative pointers 2015-03-19 16:46:00 +03:00
PKEuS bc5132e0ac Refactorization: Moved declaration of errout, ... to testsuite.h, uniformized style 2015-03-11 22:54:43 +01:00
Daniel Marjamäki 6646a896f9 Fixed #6446 (FP zerodivcond on double arithmetics) 2015-03-03 15:50:31 +01:00
Robert Reif 130ffc5752 Fixed #6538 (Symboldatabase: improve isFunction) 2015-02-24 06:11:31 +01:00
Daniel Marjamäki fb5cc6fded Fixed #5905 (isSameExpression: comparisons 'a<b' and 'a>b' are same) 2015-02-23 16:38:55 +01:00
Daniel Marjamäki 830d1eb3fd Revert "Fixed #6538 (Symboldatabase: improve isFunction)"
This reverts commit d7ef89bbe6.

There was crashes in a Travis job.
2015-02-23 08:07:19 +01:00
Robert Reif d7ef89bbe6 Fixed #6538 (Symboldatabase: improve isFunction) 2015-02-23 06:49:50 +01:00
PKEuS 5f31242ee8 CheckOther::checkRedundantAssignment(): Bail out on inline assembly (#6525) 2015-02-22 12:03:53 +01:00
Daniel Marjamäki e9663873e5 TestOther: refactoring library testing 2015-02-17 15:52:45 +01:00
Alexander Mai 0a6babea74 #6181 Drop redundantGetAndSetUserId. Ensure (style-) warnings are issued if setuid()/getuid() and some related functions are ignored. Move strdupa()/strndupa() from posix.cfg to gnu.cfg 2015-02-16 22:19:51 +01:00
Daniel Marjamäki d83f07dddd TestOther: moved posix.cfg testing 2015-02-16 16:25:27 +01:00
PKEuS 21cb0cfd60 Take simplifyIfNotNull and simplifyIfNot out of simplifyTokenList1 (first step for #6072) 2015-01-31 20:12:02 +01:00
PKEuS 0488f45a5f Removed standalone check CheckOther::checkDoubleFree(), integrated (most of) the functionality into CheckLeakAutoVar. Added support for new/delete to checkLeakAutoVar. 2015-01-28 17:38:43 +01:00
Daniel Marjamäki 3285f85ebf Fixed #6460 (Library: better function/type matching) 2015-01-27 17:55:18 +01:00
Thomas Jarosch 58cb6cc116 Add new "style" check to catch redundant pointer operations
Doing "&*some_ptr_var" is redundant and might be the remainder
of a refactoring. Warnings for expanded macros are excluded though:
They are often used with and without pointers and
do something like this: "func(&(*macroarg))".

The new check is fully AST based and was given
strong false positive testing on a large code base.
2015-01-18 00:34:07 +01:00
Thomas Jarosch cf64fd3dad Add more complex variation of the #6406 unit test
This is a false negative right now.
2015-01-15 14:45:10 +01:00
Thomas Jarosch 0286abfb45 Add unit test for #6406 2015-01-14 23:05:33 +01:00
Daniel Marjamäki a80101f277 CheckMemoryLeak: Fix FP for allocation functions that register memory before returning it 2015-01-05 13:23:38 +01:00
Daniel Marjamäki fb685f096a CheckOther:checkNegativeBitwiseShift: Fix FP when shift is protected by ?: 2015-01-05 10:01:04 +01:00
Daniel Marjamäki 7bafbfbd6e Tokenizer: cleanup simplification of '!= 0' to avoid FP in 'x[(y & 0x80) != 0]' (linux) 2015-01-04 13:50:54 +01:00
PKEuS 267552779d Improved check (#6391): Detect identical code in both branches of ternary operator 2015-01-03 18:01:49 +01:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
PKEuS 9e8a66ee40 Fixed #6373: Support bitops in clarifyCalculation check 2014-12-30 17:55:29 +01:00
Robert Reif 9e60f584d9 Fixed #6321: Implemented function Token::swapWithNext(). 2014-12-27 10:53:26 +01:00
Thomas Jarosch d5e10c18d3 checkUnreachableCode(): fix FP for statements that just hide compiler warnings about unused function arguments
Seen throughout the rockbox codebase.
2014-12-22 11:18:23 +01:00
orbitcowboy 4cbbca3db0 Refactoring: Avoid to load posix.cfg multiple times while testing (testother.cpp) (#6336) 2014-12-17 16:33:55 +01:00
Thomas Jarosch 6b78ae7c46 Add mmap() / mmap64() / munmap() to posix.cfg. Enables basic leak tracking
Includes function prototype in posix.cfg as comment
for easier overview of the function arguments.
2014-12-14 13:30:24 +01:00
Thomas Jarosch 269a4419f0 Fixed false positives about strdupa() / strndupa() memleak
strdupa() / strndupa() allocates memory on the stack using alloca().
This memory is freed automatically once the current function is left.
2014-12-10 22:23:52 +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
Dmitry-Me cb9a6c1cb5 Don't show warning for same expressions alongside == in static_assert 2014-11-13 16:04:34 +01:00
Frank Zingsheim 7e0fc3d481 Fixed #6252 (False positive "freed twice")
--HG--
extra : rebase_source : 24f801452fbefa3a59ab2cca62c3cf02aea513b6
2014-11-03 21:24:34 +01:00
PKEuS 662283cab8 Refactorization: Avoid iterations over whole token list, limited several checks to function scopes. 2014-10-31 11:42:54 +01:00
PKEuS b5ea677180 Some fixes for CheckOther::checkIgnoredReturnValue():
- Fixed name of the function
- Fixed false positive for code like "class strcmp { strcmp() {} };"
- Fixed FP #6233 on checking side (no AST generated for function call)
2014-10-30 23:24:13 +01:00
PKEuS b7996bd0b0 Handle overloads and custom implementations of functions checkReturnIgnoredReturnValue() to avoid false positives 2014-10-30 21:26:32 +01:00
Frank Zingsheim 3923618b8d Fixed #6222 (Missing varid for multiple braced initialized variables)
-> Fixed broken code in unit tests
2014-10-16 20:46:57 +02:00
PKEuS 49a14d72e7 Fixed C&P-error in unit test that was added in previous commit 2014-09-29 19:57:27 +02:00
PKEuS 374ea8f039 Fixed false positive ignoredReturnValue on unknown member function log() (#6197) 2014-09-29 19:55:32 +02:00
PKEuS 1495a411eb Fixed false positive ignoredReturnValue for variables initialized with constructor syntax (#6194) 2014-09-29 10:15:29 +02:00
PKEuS 210294443e New check: Check for unused return values (#653) 2014-09-27 21:31:04 +02:00
PKEuS cafddcb109 Fixed wrong function log10 being recommended instead of log1p 2014-09-14 13:36:12 +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
Simon Martin bf3a8686ec Ticket #6164: Added test case that now works (failed in 1.66). 2014-09-12 21:56:13 +02:00
PKEuS 6f92557478 Use information about pure/leak-ignore from library to improve accuracy of several bailouts 2014-09-11 20:27:07 +02:00
PKEuS fb0d145b34 Don't show inconclusive message redundantCopyLocalConst if --inconclusive is not set.
Ran AStyle
2014-09-11 19:45:52 +02:00
Daniel Marjamäki 7847263451 Fixed #6158 (New check: dangerous sign conversion) 2014-09-11 18:10:19 +02:00
PKEuS 865fc9aa67 Fixed #6154: Don't suggest to reduce scope if inner scope is a lambda. 2014-09-10 20:56:34 +02:00
Daniel Marjamäki 974c8688c3 Fixed #1751 (Undefined Behavior: Signed integer overflow) 2014-09-10 17:02:18 +02:00
Daniel Marjamäki f111a89639 Fixed #1757 (Undefined Behavior: Shift too many bits) 2014-09-09 07:24:59 +02:00