5486 Commits

Author SHA1 Message Date
PKEuS
3a4b7e5c07 Fixed false positive #5578 2014-03-18 13:44:27 +01:00
PKEuS
af161fc361 Rewrote CheckStl::readingEmptyStlContainer(), resolving all its false positives shown on CppChecks own code 2014-03-18 12:38:22 +01:00
Daniel Marjamäki
177bf6fcb3 Fixed #5244 (FP: (error) Uninitialized variable: ptr - initialization within if-clause) 2014-03-18 06:37:19 +01:00
Daniel Marjamäki
e240282443 Value Flow: Another try with the abstract interpretation of for loops 2014-03-17 18:43:47 +01:00
PKEuS
2568baa473 #5528: Raise duplicateExpressionError on operators /, % and -. 2014-03-17 18:35:36 +01:00
PKEuS
fab6b56360 Improved check (#5553): Detect stricmp(var.c_str(), var.c_str()) 2014-03-17 17:41:45 +01:00
PKEuS
5f67bc1b0a Fixed varId problem #5293 (and its duplicate #5577): Classes inside functions are non-executable scopes. 2014-03-17 16:15:42 +01:00
Daniel Marjamäki
06618b31bb Fixed #5574 (False positive: mismatchAllocDealloc using realloc() and free) 2014-03-17 16:10:54 +01:00
PKEuS
521734faa2 Fixed setVarId-Bugs #5294 and #5295. 2014-03-17 14:19:46 +01:00
PKEuS
b6b374cf3d Added verbose message for "memsetClass" error. (#5183) 2014-03-17 13:23:23 +01:00
PKEuS
e0b34de090 Implemented #5262: VS solution copies cfg files to output folder. 2014-03-17 12:58:46 +01:00
PKEuS
ebd0b43c4f Fixed #5382: False positive "scope can be reduced" when initializing two-dimensional array. 2014-03-17 12:34:39 +01:00
PKEuS
d325d14b11 Fixed false positive #5535: Reference named like its type. 2014-03-17 12:01:39 +01:00
PKEuS
50f6bb5d36 Fixed crash #5511. 2014-03-17 11:50:45 +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
PKEuS
1e57f54917 Fixed #5481: std::array is POD, so using memcpy (etc.) is allowed on it. 2014-03-16 19:55:32 +01:00
Lucas Manuel Rodriguez
47ecdf58b2 Fixed #4804 (Improve check for 'std::string::data()' - identical to 'std::string::c_str()') 2014-03-16 15:04:44 -03:00
Lucas Manuel Rodriguez
9a08da17be Fixed #4928 (C++ operator aliases result in false 'assigned a value that is never used' warning) 2014-03-16 14:51:05 -03:00
PKEuS
e05fb847df Fixed #3852: Support simplification of C++11 "enum class", fixed existing simplifications 2014-03-16 18:24:46 +01:00
PKEuS
6b16b519a2 Fixed crash on wrong __attribute__((constructor)) syntax 2014-03-16 16:39:07 +01:00
Alexander Mai
825bb0f027 Fixed #5286 (Add signal/exception handling to cppcheck and cppcheck-gui) 2014-03-16 12:04:13 +01:00
Alexander Mai
cba1879fee Fixed #5571 (Clean up MathLib::isInt()) 2014-03-16 11:55:44 +01:00
Daniel Marjamäki
8c3f2c2ad9 Revert 894a65b0. abstract interpretation of for loops. there was some crashes and performance problems. I will fix those problems when I have time and recommit. 2014-03-16 08:38:52 +01:00
Alexander Mai
40ddcabab6 Fixed #4461 (Warn about memset/memcpy on class with references as members) 2014-03-15 18:22:29 +01:00
Daniel Marjamäki
894a65b0b1 ValueFlow: Refactor the for-loop handling. Use abstract interpretation. 2014-03-15 11:29:33 +01:00
Daniel Marjamäki
ce1aa1e011 Library: I had misunderstood const/pure a little so I corrected cfg and code 2014-03-14 20:08:34 +01:00
Robert Reif
2ba3a36f2c Partial fix for #5555. Improved pure/const attributes handling 2014-03-14 19:06:05 +01:00
Robert Reif
e26bd5b99c Fixed #5563 (add __attribute__((destructor)) and improve __attribute__((constructor)) support) 2014-03-14 18:17:21 +01:00
Daniel Marjamäki
b2708987c3 Merge pull request #264 from thomasjfox/simplematch
Use simple match where possible
2014-03-14 17:51:45 +01:00
Alexander Mai
ff5fc82704 Fixed #4722 (Debugging enhancement: Tokenizer::simplifyTokenList() shall continue) 2014-03-14 17:48:20 +01:00
Daniel Marjamäki
a929b2146e Improved checking of const functions in checkIncorrectLogicOperator 2014-03-14 17:37:53 +01:00
Thomas Jarosch
93341f4449 Use simple match where possible
Fixes these warnings found by "--enable=internal":

[lib/checkclass.cpp:972]: (warning) Found simple pattern inside Token::Match() call: "* *"
[lib/checkbufferoverrun.cpp:635]: (warning) Found simple pattern inside Token::Match() call: "."
[lib/checkbufferoverrun.cpp:1397]: (warning) Found simple pattern inside Token::Match() call: ";"
[lib/checksizeof.cpp:299]: (warning) Found simple pattern inside Token::Match() call: "."
[lib/checksizeof.cpp:301]: (warning) Found simple pattern inside Token::Match() call: ")"
[lib/checksizeof.cpp:303]: (warning) Found simple pattern inside Token::Match() call: "]"
[lib/checksizeof.cpp:318]: (warning) Found simple pattern inside Token::Match() call: ")"
[lib/checknullpointer.cpp:413]: (warning) Found simple pattern inside Token::Match() call: "delete"
[lib/checkio.cpp:1336]: (warning) Found simple pattern inside Token::Match() call: "> ("
[lib/checkstl.cpp:1509]: (warning) Found simple pattern inside Token::findmatch() call: ";"
[lib/checkstl.cpp:1512]: (warning) Found simple pattern inside Token::findmatch() call: ";"
[lib/checkstl.cpp:1594]: (warning) Found simple pattern inside Token::Match() call: "="
[lib/checkstl.cpp:1598]: (warning) Found simple pattern inside Token::Match() call: "] ="
[lib/checkunusedvar.cpp:755]: (warning) Found simple pattern inside Token::Match() call: "goto"
[lib/checkunusedvar.cpp:793]: (warning) Found simple pattern inside Token::Match() call: "="
[lib/checkuninitvar.cpp:376]: (warning) Found simple pattern inside Token::Match() call: "> ("
[lib/checkother.cpp:86]: (warning) Found simple pattern inside Token::Match() call: "> ("
[lib/checkother.cpp:2181]: (warning) Found simple pattern inside Token::Match() call: "> {"
[lib/valueflow.cpp:54]: (warning) Found simple pattern inside Token::Match() call: "&"
[lib/valueflow.cpp:409]: (warning) Found simple pattern inside Token::Match() call: "do"
[lib/valueflow.cpp:425]: (warning) Found simple pattern inside Token::Match() call: ") {"
[lib/valueflow.cpp:487]: (warning) Found simple pattern inside Token::Match() call: ") {"
[lib/valueflow.cpp:511]: (warning) Found simple pattern inside Token::Match() call: "} else {"
[lib/valueflow.cpp:615]: (warning) Found simple pattern inside Token::Match() call: "for ("
[lib/symboldatabase.cpp:80]: (warning) Found simple pattern inside Token::Match() call: "= {"
[lib/symboldatabase.cpp:1069]: (warning) Found simple pattern inside Token::Match() call: "std ::"
[lib/tokenize.cpp:2207]: (warning) Found simple pattern inside Token::Match() call: "< >"
[lib/tokenize.cpp:2730]: (warning) Found simple pattern inside Token::Match() call: ";"
[lib/tokenize.cpp:4234]: (warning) Found simple pattern inside Token::Match() call: "try {"
[lib/tokenize.cpp:4235]: (warning) Found simple pattern inside Token::Match() call: "} catch ("
[lib/tokenize.cpp:5500]: (warning) Found simple pattern inside Token::Match() call: "INT8"
[lib/tokenize.cpp:5752]: (warning) Found simple pattern inside Token::Match() call: "}"
[lib/tokenize.cpp:5752]: (warning) Found simple pattern inside Token::Match() call: "do"
2014-03-14 16:27:47 +01:00
Thomas Jarosch
c625606f45 Remove redundant code 2014-03-14 15:56:40 +01:00
Thomas Jarosch
c80f272176 Run astyle 2014-03-14 15:51:15 +01:00
Daniel Marjamäki
8c7cf090c4 Merge pull request #261 from orbitcowboy/master
MathLib:isHex(): fix detection of missing suffixes (U,L).
2014-03-14 13:00:35 +01:00
orbitcowboy
74d10cd6d9 Added function MathLib::isValidSuffix() 2014-03-14 11:46:41 +01:00
orbitcowboy
71ee625aab MathLib: replaced isHexDigit function by isxdigit. 2014-03-14 09:33:20 +01:00
Daniel Marjamäki
401b43c36a Merge pull request #263 from trulabs/master
Fix the detection of methods called from Qt's invokeMethod
2014-03-14 08:21:53 +01:00
Daniel Marjamäki
8d8913a168 Partial fix for #5555. Add const,pure attributes to library. 2014-03-14 06:38:45 +01:00
Robert Reif
8c993c1363 Partial fix for #5555. Remember function attributes: pure, const, constructor, destructor 2014-03-14 05:40:17 +01:00
Daniel Marjamäki
5698f7b337 astyle formatting 2014-03-14 05:36:44 +01:00
Sam Truscott
5dc13f3538 Tidy up the code for cppcheck style. 2014-03-13 16:47:00 +00:00
Sam Truscott
3d0524ecc6 Update the detection of the arguments in Qt's invokeMethod.
invokeMethod can invoke functions by name (string) rather than a
direct function call (i.e. reflection). The old code wasn't
correctly parsing out the argument which contained the name
of the function to call.

This resulted in that function being reported as unused when it is.
2014-03-13 16:43:25 +00:00
Daniel Marjamäki
61eb262244 Fixed #5215 (segmentation fault (invalid code) in TemplateSimplifier::useDefaultArgumentValues) 2014-03-12 19:36:22 +01:00
Robert Reif
cb1fc06a80 Fixed #5079 (CheckIO::checkFileUsage doesn't support wide char and microsoft functions) 2014-03-12 19:22:44 +01:00
Frank Zingsheim
b1dc51ba9c Fixed #4796 (Missing semicolon after simplified template class) 2014-03-12 06:09:45 +01:00
Robert Reif
d1eb04c539 Fixed #4302 (Member variable not initialized in public delegate constructor) 2014-03-12 05:48:13 +01:00
Daniel Marjamäki
618c26f6bf Merge pull request #260 from orbitcowboy/master
MathLib::isOct() fix missing detection of U and L suffix combinations an...
2014-03-12 05:30:35 +01:00
Daniel Marjamäki
3b4d024e06 Reverted info message that only applies to CLI 2014-03-11 20:55:02 +01:00
orbitcowboy
ed793793db MathLib:isHex(): fix detection of missing suffixes (U,L). 2014-03-11 20:02:04 +01:00