Commit Graph

5907 Commits

Author SHA1 Message Date
Alexander Mai ab2f8bfba3 Tidy up MathLib::isInt() - using a state machine approach 2014-04-10 22:46:55 +02:00
PKEuS b10fce304e Don't suggestInitializationList for arrays used as initializer (#5640) 2014-04-10 22:28:02 +02:00
PKEuS 2aaae741dd Fixed cppcheck message 2014-04-10 21:58:53 +02:00
PKEuS c33498fa0b Fixed false positive redundantAssignment when operator() is called (#5568) 2014-04-10 21:56:30 +02:00
Alexander Mai 559a2bc2c8 Avoid FP exceptThrowInNoThrowFunction and exceptThrowInNoexecptFunction 2014-04-10 21:55:49 +02:00
PKEuS e39b89efc3 Throw more syntaxErrors from SymbolDatabase, fixing #5663 2014-04-10 20:11:03 +02:00
PKEuS 25b1f2f541 Fixed #5643 (crash on address-of-operator& in condition) as suggested by serval2412 2014-04-10 19:49:21 +02:00
Alexander Mai e19129a409 Fix #4724 (Error in calculation shift operation: wrong sign: 1UL << 63) 2014-04-10 19:22:14 +02:00
Robert Reif b0af67f369 Fixed #5486 (false positive: (warning) %zd in format string (no. 1) requires 'ssize_t' but the argument type is 'ssize_t {aka long}'.) 2014-04-10 17:25:11 +02:00
Robert Reif 847d28d283 Fixed #5638 (is there any plan to check noexcept correctness?) 2014-04-10 16:17:10 +02:00
Robert Reif 4ae204e46b Fixed #5659 (False negative: mismatching allocation / deallocation whith using namespace) 2014-04-10 16:11:11 +02:00
Daniel Marjamäki c8ae1e4751 Fixed #5658 (false positive: (error) Uninitialized variable: s) 2014-04-10 15:59:37 +02:00
Daniel Marjamäki 9b1d058410 Fixed #5660 (false positive: (error) Uninitialized variable: result) 2014-04-10 06:40:53 +02:00
Daniel Marjamäki 59cd1879db Fixed #5467 (False positive incorrectly claiming use after erase) 2014-04-09 10:32:56 +02:00
Alexander Mai 89dc652af9 #5631 Typo and misleading error message in negativeMemoryAllocationSize 2014-04-08 20:23:00 +02:00
Daniel Marjamäki d7e2e3bd5e Fixed #5502 (FP: Dereferencing 'b' after it is deallocated / released) 2014-04-06 18:45:24 +02:00
Daniel Marjamäki 456e33fc7b Code cleanup
[ci skip]
2014-04-05 08:27:52 +02:00
Daniel Marjamäki 049d68ae7d AST: Fixed bad syntax tree for 'if (x()[0]==1);' 2014-04-05 08:03:24 +02:00
Alexander Mai 173a2e9ea2 #5641 fix crash within CheckClass::initializeVarList() 2014-04-04 22:13:51 +02:00
Daniel Marjamäki 0788e64eb8 Removed unused function expressionsHasSideEffects() 2014-04-04 07:04:19 +02:00
Daniel Marjamäki 8dcb3bae47 Refactoring checks of overlapping conditions in if and else-if 2014-04-03 19:35:50 +02:00
Daniel Marjamäki 1a83338faf Refactoring. Created utility function isOppositeCond() 2014-04-03 17:08:42 +02:00
Daniel Marjamäki 110f956029 code cleanup for invertOperatorForOperandSwap() 2014-04-03 16:22:07 +02:00
Daniel Marjamäki ffac614f7e Fix Cppcheck warning. Use reference to avoid redundant data-copy 2014-04-03 16:16:39 +02:00
PKEuS d9358de8b4 Refactorization: Use templates and rValue references
-> Performance gain of up to 15% on entire checking time (depends on setup; Result was checked with VS12 (x64), matchcompiled version, ran on tinyxml and cppcheck itself)
2014-04-03 15:03:37 +02:00
Daniel Marjamäki dcc245be9e Merge pull request #283 from Dmitry-Me/bracemacroparameter
Macro parameter was not braced.
2014-04-03 07:22:34 +02:00
Daniel Marjamäki 9f80f3a4e8 Small cleanups in the code 2014-04-03 06:37:02 +02:00
Daniel Marjamäki a115bbbbb5 Refactoring CheckOther::checkCharVariable() using AST 2014-04-03 06:27:29 +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
Daniel Marjamäki 189360ae20 ValueFlow: changed back bailout message 2014-04-02 19:22:40 +02:00
Daniel Marjamäki f13be7fb6c Travis: Fixed possible null pointer dereference reported by travis 2014-04-02 19:08:44 +02:00
PKEuS a6e134e811 Removed compatibility code for Borland and Sun compilers which should not be necessary for a compiler supporting C++11 (as required by cppcheck). 2014-04-02 17:26:59 +02:00
Dmitry-Me 3244a61cac Macro parameter was not braced. 2014-04-02 09:25:13 +04:00
Daniel Marjamäki 3c64c70ce2 ValueFlow: Added utility functions getValueLE and getValueGE to simplify usage 2014-04-02 06:49:28 +02:00
Daniel Marjamäki bc9bb17025 Refactor CheckOther::oppositeInnerCondition() using AST and isSameExpression() 2014-04-02 16:54:01 +02:00
PKEuS e9411e05ba Refactorized inefficient usage of std::string and const char[]. 2014-04-02 13:56:34 +02:00
Daniel Marjamäki f4cdb2c46a CheckOther::checkCharVariable: Refactoring using AST 2014-04-01 19:16:06 +02:00
PKEuS 5953f02654 Refactorization: Simplifications in symboldatabase 2014-04-01 10:13:00 +02:00
Daniel Marjamäki 830249d72e Fixed #5510 (FP: nullPointer - variable initialized in function call) 2014-04-01 07:06:20 +02:00
PKEuS e0574feabd Fixed problems with unknown macros for inline class methods in SymbolDatabase (#5621) 2014-03-31 21:04:01 +02:00
PKEuS 025850d961 Support unknown THROW()-style macros in symboldatabase; Fixed #5056.
Simplified related code.
2014-03-31 20:33:01 +02:00
Daniel Marjamäki 484483bd5d AST: fixed ast for 'for (*x=0;y;z)' 2014-03-31 17:16:13 +02:00
Daniel Marjamäki 225fb96554 Fixed #5627 (False positive assignBoolToPointer) 2014-03-31 15:55:54 +02:00
Daniel Marjamäki 088664d626 Fixed compiler warning 'conversion from unsigned long to unsigned int, may loose value' 2014-03-31 06:50:59 +02:00
Daniel Marjamäki 640431c569 Fixed #5611 (segfault when checking pcsc-cyberjack. either symboldatabase or checkMemset) 2014-03-30 17:38:07 +02:00
PKEuS 060f9035c9 Fixed crashs on garbage code (#5604) 2014-03-30 11:38:01 +02:00
PKEuS aa527cb408 Refactorization: Store sizes as int, not as string in Tokenizer::simplifySizeof(). 2014-03-30 11:21:40 +02:00
PKEuS 345a80f4d5 Fixed #5621 and slightly simplified symboldatabase code. 2014-03-30 11:06:44 +02:00
Alexander Mai 5fc89656c0 Fix some uninitialized variables 2014-03-30 10:22:06 +02:00
Alexander Mai 70885c78e4 Fix endless recursion within CheckClass::isConstMemberFunc() caused by incomplete/missing template declaration 2014-03-30 10:09:57 +02:00
Alexander Mai bf335217cd Fix #5605 part 2 - now endless recursion within CheckClass::isMemberFunc() 2014-03-30 08:31:02 +02:00
Daniel Marjamäki 348c26f59c fixed segmentation fault in case typeStartToken() returns 0 2014-03-29 21:01:21 +01:00
Daniel Marjamäki efc84ac310 Fix segmentation fault when checking build/tokenize.cpp 2014-03-29 20:41:17 +01:00
Daniel Marjamäki deef4642d4 Buffer overrun: removed some old code that is not based on valueflow 2014-03-29 20:22:35 +01:00
Daniel Marjamäki e5301b2b7a ValueFlow: Improved valueflow of for loop 'for (i=a; i<10; i++)' => unknown start value but end value is known 2014-03-29 20:20:22 +01:00
Daniel Marjamäki 407c9fdf9d Refactored checkNegativeBitwiseShift() so it uses ast and valueflow 2014-03-29 13:01:30 +01:00
Alexander Mai d1b1699bb0 Fix #5606 - Endless recursion in CheckClass::isMemberVar(). New function Type::hasCircularDependencies() is supposed to detect loops within the class hierarchy which was causing the problem 2014-03-29 12:21:35 +01:00
Alexander Mai 34d1f885a3 Ticket #4296: Improve message text for operatorEq 2014-03-28 20:29:33 +01:00
PKEuS 4ad7ef69c6 Updated german translation
ran lupdate gui.pro
Reverted accidential change in checkio.cpp
2014-03-28 19:06:48 +01:00
PKEuS a01bfcb62d Fixed a few cppcheck messages 2014-03-28 18:55:16 +01:00
PKEuS 4e19645d62 Added C++11 keywords / C11 types 'char16_t' and 'char32_t' (#3301) 2014-03-28 18:24:39 +01:00
Daniel Marjamäki 502ba95383 Simplification. Code 'else if ..' is simplified to 'else { if ..' 2014-03-28 18:21:56 +01:00
PKEuS a16d631813 Further improvements to setVarId and function/array pointer detection in SymbolDatabase (#2872) 2014-03-28 17:43:40 +01:00
PKEuS 1c58628223 Handle pointer/reference to array in setVarId (#2645) 2014-03-28 16:10:27 +01:00
PKEuS 50a94885ce Fixed oppositeInnerCondition check:
- Resolved false positives #4170 and #4186, as well as numerous other potential false positives
- Improved message to point to both locations
- Inner condition could also be a while loop; Outer if could also be 'else if'
- Made the check non-experimental again (#3645)
2014-03-28 14:55:17 +01:00
PKEuS a6ca3cf2cf Throw syntaxError when encounter one in symboldatabase (fixes #5572) 2014-03-27 19:06:13 +01:00
PKEuS efe3f834be Refactorized handling of syntaxError: Print debug output, removed a few return values that are no longer required 2014-03-27 18:41:52 +01:00
Daniel Marjamäki ab25741fee Merge pull request #277 from Dmitry-Me/getridofassertinisdigit
Get rid of assert in isdigit
2014-03-27 17:18:06 +01:00
Daniel Marjamäki 581886636d CheckBool::checkComparisonOfBoolExpressionWithInt: Rewrite the check using AST instead of token list 2014-03-27 16:10:43 +01:00
PKEuS 9b307cf8e0 Improved readability of testsuite output when ASSERT_EQUALS_MSG fails.
Fixed another true positive in checkbufferoverrun.cpp
AStyle
2014-03-27 16:06:30 +01:00
PKEuS e8c7a723f5 Fixed five new true positives in cppcheck, silenced one new false positive (see #5618) 2014-03-27 15:50:30 +01:00
PKEuS 7e4081f7f5 Treat syntaxError and cppcheckError as InternalErrors (throw as exception, #4268) 2014-03-27 13:15:21 +01:00
PKEuS b23aebf2f0 Show redundantCopyLocalConst for STL types (#4331) 2014-03-27 11:15:17 +01:00
PKEuS 379807a8ea Fixed TODO_ASSERT_EQUAL and #5614 caused by bad simplification of return values. 2014-03-27 11:04:31 +01:00
Dmitry-Me d0b3728328 Get rid of assert in isdigit() when processing cyrillic characters. 2014-03-27 10:23:47 +04:00
Daniel Marjamäki 2248cdfea0 CheckBool::checkAssignBoolToPointer: Refactor to use AST. 2014-03-27 05:39:48 +01:00
Dmitry-Me d0e51fb5f0 Make use of Visual C++ runtime memory leak tracing 2014-03-26 19:43:12 +04:00
PKEuS f71a4ad216 Improved information message on missing headers when included with <> (#4772) 2014-03-26 15:22:22 +01:00
PKEuS 6c4e8761c8 Fixed false positive "unused function" #5113. 2014-03-26 12:34:21 +01:00
PKEuS 848d079c71 Refactorized detection of function usage in CheckUnusedFunction, fixed #5358 2014-03-26 09:12:41 +01:00
PKEuS 02f38772cc Refactorization: Use SymbolDatabase to find functions in CheckUnusedFunctions 2014-03-26 08:54:56 +01:00
Daniel Marjamäki d22da5e683 astyle formatting
[ci skip]
2014-03-26 06:56:13 +01:00
Daniel Marjamäki fa7ae1ae5b Fixed segfault when checking libusbx (daca2) 2014-03-26 06:51:56 +01:00
Daniel Marjamäki 8eeda150cf ValueFlow: Improved simplification inside for-loops 2014-03-25 21:40:36 +01:00
Daniel Marjamäki 87daf5783e buffer overflow: clean up old checking for negative index 2014-03-25 20:37:32 +01:00
Troshin V.S 840fba7672 CLI: Add -l command line option 2014-03-25 18:35:59 +01:00
Daniel Marjamäki c8004a8d31 Buffer overruns: Use ValueFlow to detect negative index 2014-03-25 18:22:22 +01:00
PKEuS 5083dd4273 Fixed two visual studio warnings 2014-03-24 18:14:23 +01:00
Daniel Marjamäki aa05bf0f16 ValueFlow: Improved abstract interpretation 2014-03-24 06:48:06 +01:00
Daniel Marjamäki 2a0716449f Fixed #5498 (C++0x11 default values for class fields and missing constructor) 2014-03-24 06:15:51 +01:00
Daniel Marjamäki dbc8273cb7 ValueFlow: improved abstract interpretation of for loops 2014-03-24 00:16:02 +01:00
Daniel Marjamäki c14a3d67bb ValueFlow: Handle division by zero better in abstract interpretation 2014-03-23 20:37:56 +01:00
PKEuS 1be7bfa7fe Fixed crash on invalid code (#5603) 2014-03-23 20:08:16 +01:00
Daniel Marjamäki 30fa187b30 Fixed #5549 (ValueFlow: Handle static variables better in valueFlowAfterAssign) 2014-03-23 17:57:27 +01:00
PKEuS 5f2067e401 Refactorized dead code elimination:
- Use library to get noreturn functions
- Fixed do-while simplification (#4940)
2014-03-23 10:59:41 +01:00
PKEuS 77c17100ec Bailout in private function usage checking for operators (#5059). 2014-03-23 10:06:14 +01:00
PKEuS 8d5be8c4a4 Fixed related issues to #5601 2014-03-22 22:35:20 +01:00
PKEuS 58c2f372b9 Fixed false positive when noreturn function is defined (#5601, second attempt) 2014-03-22 19:55:13 +01:00
PKEuS 6395cb9b95 Syntax error on invalid enum (#5600) 2014-03-22 19:31:01 +01:00
Daniel Marjamäki b6276058da Value Flow: Improved abstract interpretation of arithmetical expressions 2014-03-22 19:02:33 +01:00
PKEuS 77c871035b Fixed false positive when noreturn function is defined (#5601) 2014-03-22 18:57:19 +01:00
Daniel Marjamäki 7d2357de8d Refactoring. Use astIsFloat() 2014-03-22 18:42:29 +01:00
PKEuS 560cf397d3 Fixed C++11 right angle bracket issue #5150 2014-03-22 13:34:15 +01:00
Alexander Mai 6a08c27183 Fix segfault in variableIsUsedInScope() - loop variable not check against NULL 2014-03-22 11:14:11 +01:00
Alexander Mai e1c565357a Invalid code cause SIGSEGV since loop variable tok2 was not checked properly 2014-03-22 10:32:24 +01:00
Alexander Mai cdd6d4df27 Removing a useless variable to fix cppcheck warning in its own code 2014-03-21 22:11:10 +01:00
Alexander Mai 37befc75ef In case of a loop within the class hierarchie Function::isImplicitlyVirtual_rec() was entering an endless loop. Tracking the previously analyzed types shall prevent this. 2014-03-22 08:49:28 +01:00
PKEuS 49b25b05d9 Fixed crash in CheckBufferOverrun on garbage code (#5595) 2014-03-21 13:20:44 +01:00
Daniel Marjamäki 045e9e692b ValueFlow: restricted bailouts in for loops 2014-03-21 08:48:49 +01:00
Daniel Marjamäki fc014f055f ValueFlow: Removed wrong bailout 2014-03-21 08:33:45 +01:00
Daniel Marjamäki 54e7f34f4a Fixed #5584 (FP: Division by zero when function not declared) 2014-03-20 16:12:58 +01:00
XhmikosR be0fcefe1d Tabs to spaces.
[ci skip]
2014-03-20 09:02:14 +02:00
Daniel Marjamäki 22a5881bee Uninitialized variables: Experimental checking for passing const pointer to partially initialized struct to function. Ticket: #5586 2014-03-20 07:19:35 +01:00
Daniel Marjamäki 8de4246713 Uninitialized variables: Improved handling of function calls when struct members are checked 2014-03-20 06:48:17 +01:00
Daniel Marjamäki e48dfb0e6a cygwin: apply cygwin compilation tweaks. thanks ir0nh34d. 2014-03-19 21:20:30 +01:00
Robert Reif 5c88934431 CheckIo: Fixed FIXME 2014-03-19 20:57:33 +01:00
Robert Reif 806ef44509 Fixed #5328 (Does not handle __attribute((xxx)) in typedefs) 2014-03-19 05:38:23 +01:00
PKEuS b564986d5d Added missing casts causing assertion failures on Windows (#5391)
-> Changed much more occurences, especially in preprocessor.cpp.
2014-03-18 21:41:47 +01:00
Daniel Marjamäki ebb0c50aac Tokenizer: Fix crash in Token::previous() method ('this' is NULL) 2014-03-18 20:29:37 +01:00
Daniel Marjamäki 01c29ed15f Fixed #5518 (FP regression in 1.64: Array accessed out of bounds) 2014-03-18 17:04:33 +01:00
PKEuS a3f5beb75d Fixed problems with code "enum class { };" (which is valid C) 2014-03-18 16:23:30 +01:00
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
Daniel Marjamäki 94454df14f Fixed #2732 (Make it easier for users to tell 'How to supply header files') 2014-03-11 16:05:19 +01:00
Sam Truscott 385478d89e Reflection no longer part of markup. Some tokeniser not done on markup. 2014-03-11 15:57:28 +01:00
Daniel Marjamäki af0cf9bbc1 Merge pull request #258 from orbitcowboy/master
MathLib::isBin(): fix missing detection of U and L suffix combinations. ...
2014-03-11 06:36:31 +01:00
orbitcowboy 5b4ece4f9c MathLib::isBin(): fix missing detection of U and L suffix combinations. Added missing test cases. 2014-03-10 17:23:07 +01:00
Julian Santander fae8ef48b8 Fixed #5529 (Further control in selecting what configurations to consider) 2014-03-10 15:49:02 +01:00
Martin Ettl 0360840753 MathLib::isOct() fix missing detection of U and L suffix combinations and unittests. 2014-03-09 21:14:14 +01:00
Frank Zingsheim 5e0a575091 Optimization: tokenlist::addtoken 2014-03-09 17:54:49 +01:00
Frank Zingsheim bc1ab4c48a Optimization preprocessor.cpp use string::compare for charT 2014-03-09 14:26:16 +01:00
Frank Zingsheim 6e9e20d5b1 Optimization Tokenizer::simplifyMathFunctions. Make an a priori check whether the token combination can be a function call at all. 2014-03-09 13:22:58 +01:00
Daniel Marjamäki 4d06bc086d astyle formatting 2014-03-09 08:49:32 +01:00
Daniel Marjamäki 7fa73c0d64 Merge pull request #256 from xypron/5505
5505: FP: Array accessed out of bounds
2014-03-09 08:47:18 +01:00
Daniel Marjamäki c7f09d4350 Merge pull request #257 from simartin/ticket_5373_2
Ticket #5373: delete can match %type% in C (take #2)
2014-03-09 08:26:06 +01:00
Alexander Mai 3f30753122 Fixed #5537 (crash: clang ./lib/Basic/FileManager.cpp , since 354e84e7c8 , /lib/symboldatabase.h:288) 2014-03-09 08:17:24 +01:00
Simon Martin a3d1cac79c Ticket #5373: Keep track whether tokens come from a C or C++ file to properly handle %type% in Token::Match with "delete" 2014-03-08 21:26:06 +01:00
Heinrich Schuchardt bd67db96f1 5505: FP: Array accessed out of bounds
CheckBufferOverrun::checkFunctionParameter alreacy considered usage of a
function parameter inside an if block as a special case.

With the patch the same is done for switch statements.

A test is added.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2014-03-07 19:51:13 +01:00
Daniel Marjamäki 569db24756 astyle formatting 2014-03-06 16:21:57 +01:00
Alexander Mai 354e84e7c8 Fixed #2298 (new check: passing stack-address to free()) 2014-03-06 06:32:30 +01:00
Daniel Marjamäki ca0509e20b Library: Fixed bug I caused when I cleaned up patch 2014-03-06 06:27:01 +01:00
Alexander Mai 1d4839b8a6 Fixed #1374 (false negative: using uninitialized variable in printf) 2014-03-06 06:16:14 +01:00
Daniel Marjamäki bcd230d90d Merge pull request #251 from matthiaskrgr/copyright
man, htdocs, gui, test, tools: bump a few more copyrights to 2014
2014-03-04 05:44:50 +01:00
Daniel Marjamäki dbfe7e0b6b Fixed cppcheck warnings 2014-03-03 19:00:32 +01:00
Pranav Khanna f8a4fb91fe Fixed #3796 (new check: redundant initialization with empty string) 2014-03-03 18:27:45 +01:00
PKEuS 470f1579c1 Incremented version to 1.65dev/1.64.99 2014-03-03 15:07:54 +01:00
Matthias Krüger a9df4a3288 man, htdocs, gui, test, tools: bump a few more copyrights to 2014 2014-03-03 11:03:17 +01:00
Simon Martin 8baf8dbebb Ticket #5425: Avoid infinite recursion in checkMemsetType for invalid input 2014-03-03 07:19:32 +01:00
Daniel Marjamäki 4dee3da1bd Merge pull request #245 from simartin/ticket_5478
Ticket #5478: Only functions and equal operators might return a temporary
2014-03-02 14:53:25 +01:00
Daniel Marjamäki 4842115a56 1.64 : Update versions 2014-03-02 09:55:39 +01:00
Simon Martin 875a3f47e7 Ticket #5478: Only functions and equal operators might return a temporary. 2014-03-02 09:39:10 +01:00
Daniel Marjamäki aec3f18d77 Merge pull request #244 from simartin/ticket_5506
Ticket #5506: Don't crash upon invalid template declaration
2014-03-02 08:54:07 +01:00
Simon Martin 3518e02d23 Ticket #5506: Skip template parameters when determining whether a template is a declaration or a definition. 2014-03-01 14:58:47 +01:00
Daniel Marjamäki bef4739853 Library: the bug in tinyxml has been fixed so the workaround can be removed now 2014-03-01 14:09:03 +01:00
PKEuS 357f5076db Updated tinyxml 2014-03-01 11:15:08 +01:00
Daniel Marjamäki a41a32ba8a Fixed #5469 (CheckBufferOverrun: Use nullptr) 2014-02-28 17:02:03 +01:00
Alexander Mai 50a184c3e9 Fixed #5166 (segmentation fault (invalid code) in lib/checkother.cpp:329 ( void * f { } void b ( ) { * f } )) 2014-02-27 18:24:51 +01:00
Daniel Marjamäki 87c4508954 Spell fix: dont => do not 2014-02-27 16:40:42 +01:00
Alexander Mai a02bbfa47e Fixed #5492 (Fix small bug in MathLib::isFloat()) 2014-02-27 16:08:49 +01:00
Daniel Marjamäki dea4107245 Fix Cppcheck warning 2014-02-26 06:38:48 +01:00
Daniel Marjamäki 7dbfd67da3 Fixed #5493 (False positive: Found a statement that begins with numeric constant / string constant - in the presence of initialization list.) 2014-02-26 06:18:52 +01:00
Daniel Marjamäki 8550289722 Fixed #5452 (AST: wrong handling of unary ::) 2014-02-25 06:36:10 +01:00
Alexander Mai 0747b55485 Fixed #5304 (Wrong simplification of numbers like 001E+07 to 1.0) 2014-02-24 18:52:31 +01:00
Daniel Marjamäki acf5723bdd AST: improved AST printout when --verbose is used 2014-02-24 17:22:29 +01:00
Daniel Marjamäki 8dd7f02e45 Fixed #5381 (Some false positives that came up when using --enable=performance file.c) 2014-02-23 11:02:39 +01:00
Daniel Marjamäki f6b42633e8 Fixed #5434 (FP: Out-of-bounds access with ternary operator in loop) 2014-02-22 17:59:12 +01:00
Daniel Marjamäki 34730f623a Fixed #5301 (False positive: (error) Division by zero - variables read from input stream) 2014-02-22 12:09:54 +01:00
Daniel Marjamäki 910a90e4c1 Revert "cxx11.h: removed the 'evil workaround'"
This reverts commit 2cb9032d76.
2014-02-21 20:06:55 +01:00
Alexander Mai 82a2279425 Fixed #5304 (Wrong simplification of numbers like 001E+07 to 1.0) 2014-02-20 16:56:49 +01:00
Daniel Marjamäki ed9153ee80 Symbol database: added simple mismatch check in Scope::findFunction when passing address to function that expects a reference 2014-02-19 06:35:51 +01:00
Daniel Marjamäki 690c37633b ValueFlow: Fixed bad values after break/continue 2014-02-17 20:07:38 +01:00
Daniel Marjamäki c050a92bae Fixed #5468 (crash: freebsd: llvm/RegionPrinter.cpp - AST failure) 2014-02-17 17:37:39 +01:00
Daniel Marjamäki d37359217c Merge pull request #241 from lanurmi/more-nullptr
Change some more 0 literals into nullptr.
2014-02-16 23:29:23 +01:00
Lauri Nurmi 70a67eaf85 Change some more 0 literals into nullptr. 2014-02-16 13:38:50 +02:00
Daniel Marjamäki fdcb325d70 DuplicateBranch: Made warning inconclusive since it's in most cases noise 2014-02-16 11:04:27 +01:00
Daniel Marjamäki 23efc68dd7 use nullptr 2014-02-16 10:32:10 +01:00
Lucas Manuel Rodriguez 052840f8f5 Fixed #4818 (New check: Check memset() 2nd parameter) 2014-02-15 15:06:00 -03:00
Daniel Marjamäki 2cb9032d76 cxx11.h: removed the 'evil workaround' 2014-02-15 16:19:50 +01:00
Daniel Marjamäki f0220c5340 astyle formatting 2014-02-15 16:18:13 +01:00
Daniel Marjamäki 209dffbe1b use nullptr in lib/checkmemoryleak.cpp 2014-02-15 16:17:56 +01:00
Daniel Marjamäki 68119f0230 use nullptr in lib/checknullpointer.cpp 2014-02-15 16:12:37 +01:00
Daniel Marjamäki fb5c2d4b48 use nullptr in lib/checkother.cpp 2014-02-15 08:46:28 +01:00
Daniel Marjamäki 720bd48a98 use nullptr in lib/library.cpp 2014-02-15 08:41:17 +01:00
Daniel Marjamäki 9eb789bdb2 use nullptr in lib/preprocessor.cpp 2014-02-15 08:37:57 +01:00
Daniel Marjamäki 5fe78d1534 use nullptr in lib/token.cpp 2014-02-15 08:05:54 +01:00
Daniel Marjamäki 384ffb4173 use nullptr in lib/tokenize.cpp 2014-02-15 08:04:54 +01:00
Lauri Nurmi 91340d4043 Emulate the C++11 'nullptr' and 'static_assert' 2014-02-15 07:52:17 +01:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
Daniel Marjamäki a1d9873558 Fixed #5465 (crash: AST doesnt produce good output for 'class C:public :🅰️:b<c>{..};') 2014-02-14 06:30:51 +01:00
Lucas Manuel Rodriguez 828609bb11 Fixed two doxygen errors - http://cppcheck.sourceforge.net/devinfo/doxygen-errors.txt 2014-02-09 16:46:49 -03:00
Daniel Marjamäki 8305015dea astyle formatting 2014-02-08 08:51:38 +01:00
Pavel Roschin 19a8cfd960 Library: add new "define" tag
This tag will allow to add some preprocessor defs into library.
It would be useful to provide more information about libraries
implementation details. As example GLib's library include tag
was added that helps to detect more memory leaks.
2014-02-07 10:13:36 +04:00
Daniel Marjamäki 3c6bfac89c Merge pull request #234 from scriptum/rpg-use-whitelist-from-library
CheckMemoryLeak: use library while checking whitelist functions
2014-02-05 11:41:47 +01:00
Daniel Marjamäki ec80068cd9 Merge pull request #228 from simartin/osx_build_restore
RFC: Restore build on OSX
2014-02-05 11:30:34 +01:00
Pavel Roschin 0dd227419d CheckMemoryLeak: use library while checking whitelist functions 2014-02-05 12:16:50 +04:00
Daniel Marjamäki 6ac9e180e0 ast: fixed hang when checking beid 2014-02-05 06:05:48 +01:00
Daniel Marjamäki 2ed3b40937 ast: fixed hang when checking bin-prot 2014-02-04 19:33:26 +01:00
Daniel Marjamäki 486a3192c0 Fixed #5246 (false positive: (warning) Logical conjunction always evaluates to false: t > 0 && t < 1.) 2014-02-04 06:50:29 +01:00
Daniel Marjamäki ec61143623 Merge pull request #233 from orbitcowboy/master
Fixed #389: Providing negative value to memory allocation function.
2014-02-02 10:47:37 -08:00
Heinrich Schuchardt 6bfd4af5f7 5355: False postive var not assigned
Avoid false positive "variable not assigned" for

struct Fred{
};
void foo () {
  Fred fred;
  throw fred;
}

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2014-02-01 22:40:35 +01:00
Martin Ettl 6ca7daec10 Fixed #389: Providing negative value to memory allocation function. 2014-02-01 22:38:29 +01:00
Simon Martin 8ff9696374 OSX's compiler supports C++11 but one needs to use GNU's STL to build cppcheck, that does not have cbegin/end. 2014-02-01 07:40:08 +01:00
Daniel Marjamäki b3bfd5014d Fixed #5433 (FP:Possible null pointer dereference) 2014-01-31 15:43:34 +01:00
Daniel Marjamäki 9aa9530e0d Fixed #5426 (crash: btrfs-progs cmds-inspect.c) 2014-01-31 06:19:36 +01:00
Lucas Manuel Rodriguez a34d2eb7b3 Fixed #4938: (.empty() method false positive for non-STL classes) 2014-01-30 18:09:24 -03:00
Daniel Marjamäki d6e3b3d3f3 ast: fixed syntax tree for 'a=(b)?1:0'. The parentheses should not be in the syntax tree 2014-01-30 17:31:06 +01:00
Lucas Manuel Rodriguez ad0269eeeb Refactor checks using Variable::isStlType() 2014-01-30 01:26:48 -03:00
Daniel Marjamäki 30b56437c1 Merge pull request #226 from scriptum/rpg-fix-function-parameter
CheckMemoryLeak: improve leak checking in function parameters
2014-01-28 20:32:56 -08:00
Lucas Manuel Rodriguez b69fedf70b Fix '-Wshadow' warning (from 'Fixed #5423' commit) 2014-01-28 23:16:29 -03:00
Lucas Manuel Rodriguez 7fdc4ab6cc Refactor isContainerSizeSlow() to use Variable::isStlType() 2014-01-28 13:31:23 -03:00
Kamil Dudka dee18d10a8 Fixed #5423 (fix parsing of #line NNNN "file.c") 2014-01-28 17:15:07 +01:00
Daniel Marjamäki abe8439917 Fixed #5416 (False positive: Array accessed at index, which is out of bounds.) 2014-01-28 16:55:10 +01:00
Lucas Manuel Rodriguez 2048313915 Add Variable::isStlType function 2014-01-28 11:44:56 -03:00
Pavel Roschin 2396073262 CheckMemoryLeak: improve leak checking in function parameters 2014-01-28 17:30:36 +04:00
Daniel Marjamäki 2108251851 Fixed #5417 (ast: avoid hang when '({})' is used) 2014-01-28 06:11:53 +01:00
Daniel Marjamäki c8a1424e10 Fixed #5406 (crash inside valueFlowBeforeCondition() on files from kernel-git) 2014-01-27 06:18:42 +01:00
Daniel Marjamäki 2b8cf462c9 CheckMemoryLeak: Move posix-opendir/closedir to library 2014-01-26 17:02:36 +01:00
Daniel Marjamäki 0c47555423 CheckNullPointer: use library instead of hard coded info 2014-01-26 16:19:49 +01:00
Daniel Marjamäki be082a8e4a value flow: added bailout for conditional return/continue/break when number_of_if is bigger than 0 2014-01-26 15:50:25 +01:00
Daniel Marjamäki c5971b7137 value flow: fix fp when conditional value is assigned 2014-01-25 20:14:49 +01:00
Daniel Marjamäki c1e35e1df1 value flow: fixed multivariable problem in condition 2014-01-25 19:13:33 +01:00
Daniel Marjamäki d227ed245f cleanup 2014-01-25 18:51:55 +01:00
Daniel Marjamäki df0995edf5 Fixed #5403 (Value flow: FP because post increment/decrement is not handled correctly) 2014-01-25 18:31:02 +01:00
Daniel Marjamäki bc9ad08831 Fixed #5245 (false positive: Uninitialized variable (assignment inside ternary operator)) 2014-01-25 10:12:50 +01:00
Daniel Marjamäki 35b51468cb value flow: Fixed FP for division then check in for loop: 'for (a=b/x;x>0;x--)' 2014-01-25 09:22:32 +01:00
Daniel Marjamäki 4647a9fc93 Fixed #5401 (value flow: fp when there are increment/decrement) 2014-01-24 18:22:38 +01:00
Daniel Marjamäki 1cac7e1686 value flow: better handling in function call bailout of casting address of variable 2014-01-24 17:47:49 +01:00
Daniel Marjamäki 135998abba value flow: use const when possible 2014-01-24 06:16:23 +01:00
Heinrich Schuchardt de20ba6763 [PATCH] Types in isRecordTypeWithoutSideEffects
The type definition of the iterator should match the type definition of the map <const Type *, bool>.
2014-01-24 06:10:19 +01:00
Daniel Marjamäki 85b6495cce value flow: fixed comments 2014-01-23 19:40:47 +01:00
Daniel Marjamäki ec034c1d59 Fixed #5386 (ast: hang when code is 'for (T a : b)') 2014-01-23 06:13:24 +01:00
Daniel Marjamäki 0dbb86f0cb Cleanup ExecutionPath from CheckBufferOverrun 2014-01-22 21:25:37 +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 2b7a991c1a temporarily hide gcc warnings 2014-01-21 21:17:03 +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 a84fdf98cc Null pointer: remove old checking that is replaced by value flow checking 2014-01-21 19:50:52 +01:00
Daniel Marjamäki 20b73747e0 value flow: refactor. added Token::getMaxValue() 2014-01-21 16:58:23 +01:00
Daniel Marjamäki b91f42453b value flow: improved handling of cast 2014-01-20 22:26:55 +01:00
Daniel Marjamäki bb3cc67aaa value flow: improved calculations that depends on variable 2014-01-20 21:45:30 +01:00
Daniel Marjamäki 69109784e8 value flow: cleanup usage of valueflow. utility function Token::getValue was added. 2014-01-20 06:49:45 +01:00
Daniel Marjamäki add84187cc CheckOther: Removed old zero division check 2014-01-20 06:31:13 +01:00
Daniel Marjamäki 7ff7bc1c2e Fixed #5376 (false positive: zerodivcond (style) Either the condition 'B>0' is useless or there is division by zero) 2014-01-19 20:16:55 +01:00
Daniel Marjamäki 84c5f47eb1 value flow: bailout for class variables that are non-const 2014-01-19 11:55:02 +01:00
Daniel Marjamäki ccda78f347 value flow: fixed todo assertion for handling of conditions 2014-01-19 09:31:40 +01:00
Daniel Marjamäki cdaa7abf7e value flow: better handling of conditional code below || && ?: operators 2014-01-19 09:05:48 +01:00
Daniel Marjamäki 2d0a68cac2 cleanup redundant variable inconclusive 2014-01-18 19:51:57 +01:00
Daniel Marjamäki 77f3f6c21a valueflow: added setTokenValue that perform calculations using set value 2014-01-18 19:30:44 +01:00
Daniel Marjamäki 6a3a9ee8e7 ast: fixed tree for 'sizeof(struct S)' 2014-01-18 13:18:11 +01:00
Daniel Marjamäki c7032a8867 value flow: improved handling of loops 2014-01-18 11:54:00 +01:00
Daniel Marjamäki 498cdb8610 added debug output for the value flow 2014-01-18 09:58:32 +01:00
Ryan Pavlik 32bf275447 Fix case-insensitive string compare function on MinGW 2014-01-17 15:29:53 -06:00
Daniel Marjamäki 3e23e243f6 BufferOverflow: Updated message for out of bounds array index or redundant condition 2014-01-17 19:44:45 +01:00
Daniel Marjamäki 57d318b2e5 valueflow: better handling of increment/decrement 2014-01-17 19:28:28 +01:00
Daniel Marjamäki 18d6285ad2 BufferOverrun: Improved error message when array index is used before checking that its in limits 2014-01-17 18:56:46 +01:00
Daniel Marjamäki b2b5590f2b Refactoring: Moved astStringify to the Token class and renamed it to expressionString. This can often be useful when reporting error messages that contains source code. 2014-01-17 18:37: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 5721e1d745 CheckNullPointer: Removed some of the old checking that doesn't use ValueFlow 2014-01-17 17:47:59 +01:00
Daniel Marjamäki 311059f603 Tokenizer: Removed commented-out simplification 2014-01-17 17:44:33 +01:00
Daniel Marjamäki 3facc06cb7 CheckOther: Removed non-valueflow check for division by possible zero before condition 2014-01-17 17:42:54 +01:00
Daniel Marjamäki 0203a4a6f5 Tokenizer: Removed simplifyGoto as it's the cause of various FPs I see 2014-01-17 17:36:45 +01:00
Daniel Marjamäki 4eb746d7cc Tokenizer: Removed simplifyComparisonOrder 2014-01-17 17:25:56 +01:00
Daniel Marjamäki 0b4de97e2b value flow: Use ValueFlow in CheckBufferOverrun 2014-01-16 19:23:14 +01:00
Daniel Marjamäki 85b73f7c24 ast: fixed hang for weird loop: 'for (each_window(list,p))' 2014-01-16 16:58:50 +01:00
Daniel Marjamäki e72ec830ef ast: fixed hang in for-loop handling 2014-01-16 06:45:35 +01:00
Daniel Marjamäki 141e089329 ast: different handling of for loops. create a syntax tree for whole 'f(a;b;c)'. 2014-01-15 17:32:14 +01:00
Daniel Marjamäki c547c9a108 value flow: fixed fp when variable is used in for-loop condition 2014-01-14 17:57:50 +01:00
Daniel Marjamäki e45a2e2c61 Fixed #5347 (False positive: uninitialized variable (try catch)) 2014-01-14 06:24:09 +01:00
Robert Reif d679a4c1f7 Fixed #5248 (False positive: Invalid argument in scanf for %zd) 2014-01-14 06:09:13 +01:00
Daniel Marjamäki c1c2f4bbc6 value flow: fixed crash reported in #5343 when typeStartToken and typeEndToken are misplaced. 2014-01-13 20:54:09 +01:00
Daniel Marjamäki 7981e3d38f value flow: fix fp when gotos are used 2014-01-13 16:07:25 +01:00
Daniel Marjamäki bfc67a536a value flow: fixed fp when self-checking checkbool.cpp. added some comments. 2014-01-13 06:15:21 +01:00
Daniel Marjamäki b1bbb23225 value flow: fixed fp when checking symboldatabase 2014-01-13 05:52:28 +01:00
Daniel Marjamäki f6c7be91a9 Fixed cppcheck warning 2014-01-12 21:19:20 +01:00
Daniel Marjamäki 8b6f001f94 value flow: inconclusive handling of unknown functions 2014-01-12 19:48:20 +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 2e67ca06c0 value flow: some simplifications in unknown functions when there is library configuration 2014-01-12 18:19:00 +01:00
Daniel Marjamäki ab866be03a Tokenizer: Move 'else if' simplification to tokenize 2014-01-12 17:47:02 +01:00
Daniel Marjamäki d700114edf value flow: bailout if condition is defined by macro 2014-01-12 17:16:51 +01:00
Heinrich Schuchardt f6510a6b45 Fixed #5339 (Tokenizer::setVarId : function-pointer function argument not getting variable id, causing FP) 2014-01-12 15:15:09 +01:00
Daniel Marjamäki 3d79613f2b value flow: more bailouts when return/break/continue/goto is reached. TODO: handle these better. 2014-01-12 15:07:58 +01:00
Daniel Marjamäki 155990cb0e value flow: improved checking of do-while loops for non-local variables 2014-01-12 15:02:58 +01:00
Daniel Marjamäki 5b679fc732 value flow: fixed fp for data member 2014-01-12 14:37:26 +01:00
Alexander Mai 86763b401c Fixed #5340 (Preprocessor: not using errorLogger when reporting syntax errors) 2014-01-12 13:15:54 +01:00
PKEuS b775714e3d Moved several hardcoded function names in format string checking into libraries (std.cfg and windows.cfg).
Added support for loading a library in test suite.
2014-01-12 03:44:24 -08:00
Daniel Marjamäki 21d317b7d6 value flow: fixed redundant null pointer check 2014-01-12 12:38:41 +01:00
Daniel Marjamäki d8262963d9 value flow: condition in loop, bailout valueflow analysis before loop if there is assignment inside the loop 2014-01-12 11:58:10 +01:00
Daniel Marjamäki e3496080c8 Fixed #5334 (False positive: same expression on both sides of '||') 2014-01-12 07:40:56 +01:00
Daniel Marjamäki f58e1ab80e value flow: fixed fp in switch 2014-01-11 21:21:00 +01:00
Daniel Marjamäki 3625d179e5 value flow: don't perform value flow analysis in sizeof/typeof expressions 2014-01-11 21:10:01 +01:00
Daniel Marjamäki 680d3f1312 value flow: fixed fp for nested assignments 2014-01-11 20:53:23 +01:00
Daniel Marjamäki 4d045879aa value flow: fixed fp when while condition contains variable that is changed in loop body 2014-01-11 20:25:49 +01:00
Daniel Marjamäki 75f9111775 value flow: bailout when variable is used in assignment to itself 2014-01-11 15:36:09 +01:00
Daniel Marjamäki 1fc2c9fe79 ast: fixed syntax tree for statement enclosed in parentheses ';(expr);' 2014-01-11 15:18:39 +01:00
Daniel Marjamäki ceca6be22b Fixed #5334 (False positive: same expression on both sides of '||') 2014-01-11 15:15:01 +01:00
Daniel Marjamäki eaf8c83db5 value flow: refactoring. broke out function for skipping value simplifications in expressions. 2014-01-11 14:54:10 +01:00
Daniel Marjamäki 85dcb14813 value flow: bailout in valueFlowBeforeCondition if variable can be assigned by subfunction 2014-01-11 14:31:51 +01:00
Daniel Marjamäki 225001a45c value flow: changed astparent lookup 2014-01-11 12:47:47 +01:00
Daniel Marjamäki 02b92efd1a value flow: improved analysis of expressions below ?, && and || operators 2014-01-11 12:44:55 +01:00
Daniel Marjamäki 60348da1b5 value flow: fixed fp for rhs in && and || expressions 2014-01-11 11:30:34 +01:00