Commit Graph

334 Commits

Author SHA1 Message Date
Daniel Marjamäki ed71c57f1f astyle formatting 2011-01-06 12:07:18 +01:00
Raphael Geissert 6ec4497919 [PATCH] Check for calls to memset() where 0 bytes are to be filled
Inspired by Silvio Cesare's work
2011-01-06 11:31:58 +01:00
Daniel Marjamäki 033e759c39 command line: added 'information' id to enable 2011-01-05 21:20:21 +01:00
Zachary Blair d11b5163b7 Fixed #2382 (Catching exceptions by value instead of reference) 2010-12-31 03:01:38 -08:00
Kimmo Varis e8b81f909d Change 'Scope of variable'-message to information message. 2010-12-27 16:48:03 +02:00
Kimmo Varis ad89a84796 Improve error message about overlapping buffers for s[n]printf().
See forum thread:
https://sourceforge.net/apps/phpbb/cppcheck/viewtopic.php?f=3&t=192&start=0
2010-12-26 23:44:01 +02:00
Daniel Marjamäki 81c5576eb4 Misused scope objects: Don't use this check if the checked file is a pure C file. Ticket: #2352 2010-12-25 08:43:52 +01:00
Robert Reif f12c0c7ada Tokenizer: add assert(_settings) to Tokenizer to insure the tokenizer always has settings. Ticket: #2219 2010-12-01 18:00:55 +01:00
Kimmo Varis 8d8945ac57 Improve "Assert statement 'varname' -message.
Modifying the message so that we have short message and verbose
message. As discussed in dev-forum:
https://sourceforge.net/apps/phpbb/cppcheck/viewtopic.php?f=3&t=192
2010-11-29 20:12:21 +02:00
Kimmo Varis 85735e382f Improve the 'suspicious code sizeof sizeof' -message.
As discussed at dev-forum:
https://sourceforge.net/apps/phpbb/cppcheck/viewtopic.php?f=3&t=192
2010-11-28 14:20:46 +02:00
Kimmo Varis 837605b05b Ticket #2239 (Too long "short" message about function parameter passing)
Have a proper short message for the parameter passing warning and
improve the message.
2010-11-27 10:46:34 +02:00
Zachary Blair 215cb5ac8d Fixed #2162 (false positive: Mutual exclusion over ||) 2010-11-21 00:06:43 -08:00
Daniel Marjamäki fd64a7e683 Mutual exclusion: Disable this check until #2162 is fixed. 2010-11-20 07:43:07 +01:00
Ettl Martin 88cc29ea0a mathlib: added todo testcases for ticket #2200 2010-11-15 21:03:49 +01:00
Zachary Blair 10a4dde105 Fixed #2137 (Invalid mutual exclusion report) 2010-11-04 00:10:25 -07:00
Daniel Marjamäki 14803643ca empty string test: Removed this check 2010-11-03 17:56:14 +01:00
Daniel Marjamäki bc283d8b99 Uninitialized variables: Broke out the checking into separate file 2010-10-31 12:31:11 +01:00
Daniel Marjamäki df8a93bf97 Null pointers: Broke out the checking into separate file 2010-10-31 11:51:25 +01:00
Daniel Marjamäki 995e39200b Fixed #2130 (Invalid possible NULL pointer dereference, etc.) 2010-10-27 20:20:10 +02:00
Daniel Marjamäki fc98bcdcb2 Fixed #2141 (false positive: possible null pointer dereference) 2010-10-27 19:42:47 +02:00
Daniel Marjamäki fd153eac02 Fixed #2142 (false positive: null pointer dereference (throw)) 2010-10-27 19:38:42 +02:00
Daniel Marjamäki 9370f552ac Fixed #2134 (sizeof(*list) complains of null pointer dereference) 2010-10-26 18:26:02 +02:00
Daniel Marjamäki 893f7fa347 Fixed #2130 (Invalid possible NULL pointer dereference, etc.) 2010-10-26 17:40:30 +02:00
Daniel Marjamäki bdd6d6d53d null pointer: use simplified token list in the 'check and deref' checking 2010-10-25 21:05:43 +02:00
Daniel Marjamäki 132aa8d0c4 uninitialized variables: fixed fp when analysing loops 2010-10-25 20:56:15 +02:00
Daniel Marjamäki 026514db1a Fixed #2127 (null pointer dereference after condition (SRD nr 522)) 2010-10-25 19:43:54 +02:00
Zachary Blair 26afb04dc5 Fixed #2105 (Incorrect operator: mutual exclusion over ||) 2010-10-24 18:14:21 -07:00
Daniel Marjamäki 24a2def3ad Execution Path: Fixed FP in improved handling of loop bodies 2010-10-24 19:14:40 +02:00
Daniel Marjamäki 8f707e5e46 Null pointers: Better handling of loops 2010-10-24 18:51:14 +02:00
Daniel Marjamäki 6601de7681 uninitialized variables: refactoring handling of loop bodies 2010-10-24 18:26:59 +02:00
Daniel Marjamäki b66d3c8858 Fixed #2125 (uninitialized variable: better handling of for loops) 2010-10-24 18:12:48 +02:00
Daniel Marjamäki 92a1e9e76e Severities: Added 'warning' and 'performance' severities. No changes to the command line options nor to the XML format. Ticket: #2106 2010-10-17 14:41:00 +02:00
Debrard Sebastien fb928b6778 Fixed #2018 (Postfix Operators) 2010-10-14 19:17:40 +02:00
Pete Johns fbd3d92aa9 Fixed #2084 (False positive: object destroyed immediately (struct and function with same name))
Tightened up class definition matching so as not to match C-style struct tags.
2010-10-13 20:37:53 +11:00
Debrard Sebastien 1a4e3dcc44 increment check 2010-10-12 19:54:39 +02:00
Daniel Marjamäki 3dfcbfc0e0 assignment in assert: modified the error message to better explain the reason why the warning is given. 2010-10-11 17:59:08 +02:00
Zachary Blair d9967d4fd2 Fixed #2079 (detect side effects in assert) 2010-10-10 13:05:06 -07:00
Daniel Marjamäki 3340010376 fix unit testing 2010-10-10 14:23:05 +02:00
Daniel Marjamäki a3367874d9 Fixed #1778 (false negative: nullpointer dereference (std::string pointer)) 2010-10-09 07:57:34 +02:00
Daniel Marjamäki 7b4e08385d STL: refactoring CheckStl::erase so ExecutionPath is used 2010-10-05 20:54:13 +02:00
Pete Johns 4bf9ff26ea Fixed 2071 (false positive: object destroyed immediately (when using '= { ... }'))
Simplified check within CheckOther::checkMisusedScopedObject() as a result.
2010-10-04 08:16:11 +11:00
Daniel Marjamäki cd8ef1cded Revert "temporarily disable the 'object destroyed immediately' message"
This reverts commit fa94312c9a.
2010-10-03 18:05:08 +02:00
Daniel Marjamäki fa94312c9a temporarily disable the 'object destroyed immediately' message 2010-10-03 16:59:13 +02:00
Pete Johns 78795dc3ac Fix false positive: Misused Scope Object does not pick constructors of local class declarations.
It does pick up if there is an unused construction within the function, though.
2010-10-02 22:59:04 +10:00
Pete Johns 365b1bed1a Fixed false positive: checkMisusedScopedObject no longer errors on calls to function objects. 2010-10-02 21:25:16 +10:00
Pete Johns b72b699b76 Fixed false-positive: Object is referenced on construction
struct Foo {
        void bar() {
        }
    };

    void fn() {
        Foo().bar(); // This caused a false-positive
    }
2010-10-02 20:26:29 +10:00
Pete Johns 3f72d3a877 Check misused scope object does not pick local class method.
Also fixed mistyped withinFuntion ->withinFunction.
2010-10-02 20:12:52 +10:00
Pete Johns 0017655f55 Added test for functor false-positive [passing]
Also removed typedef's following danmar's review and renamed isClassresults -> isClassResults to make more clear.
2010-10-02 18:45:24 +10:00
Pete Johns 6e0ef3eda2 Fixed #1132 (Detection of misused scope objects in functions)
Emits error in the form:

    [useless_lock.cpp:18]: (error) instance of "Lock" object destroyed immediately

    ...if an instance of a class or struct is unnamed and therefore destroyed
    straight after creation.

    Only checks for misused scope objects within functions.

    Optimised isIdentifierObjectType() by memoizing.
2010-10-02 14:22:26 +10:00
Pete Johns 50c2fa9ab0 Revert "Fixed #1132 (Detection of misused scope objects)"
This reverts commit c6acdccfa0.
2010-10-01 20:52:16 +10:00