Commit Graph

5720 Commits

Author SHA1 Message Date
PKEuS 5d302716e7 Refactorized Variable::isIntegralType() and Variable::isFloatType():
- Cached property
- Make use of it in several checks
- float* is flagged as floating point type
2014-08-09 11:45:13 +02:00
PKEuS 865df4e207 Fixed false negative #4306: Detect loop access of empty STL container 2014-08-09 10:06:44 +02:00
PKEuS 5c238692e6 New check: Division by sizeof() as parameter to memset/memcpy/memmove/etc. as they expect a size in bytes (#5698)
Refactorizations in sizeof checking:
- Changed severity of sizeofwithsilentarraypointer to warning
- Made pointerSize message conclusive - there seems to be no reason for inconclusive
2014-08-08 09:49:09 +02:00
PKEuS c4635cf698 Improved check: portability message when calling memset on a class with floating point numbers (#5421) 2014-08-08 09:49:09 +02:00
PKEuS a1b7ab277b Changed handling of unhandled characters:
- Don't abort checking (reverts 42140b6488)
- Modified error message: New Id unhandledCharacter, removed redundant line information, improved message text
2014-08-08 09:49:09 +02:00
PKEuS 56ba4b6a92 Fixed crash if va_start is passed less arguments than expected 2014-08-06 20:53:13 +02:00
PKEuS 076c1bd06c Fixed crash in CheckVaarg::va_start_argument (#6032) 2014-08-06 19:35:09 +02:00
PKEuS 639f1fa85a Fixed another variable shadowing warning. 2014-08-06 14:27:03 +02:00
Matthias Krüger b5cf56790c dmake: update 2014-08-06 14:25:49 +02:00
PKEuS 5f7b4ad0ae Added several new va_arg related checks:
- Wrong parameter passed to va_start() (#3850)
- Reference passed to va_start() (#3849)
- Missing va_end() (#3295)
- Using va_list before it is opened (#3295)
- Subsequent calls to va_start/va_copy()
2014-08-06 14:20:46 +02:00
PKEuS c3577bc8dd Fixed crash, simplified code in testassert.cpp 2014-08-06 12:24:21 +02:00
PKEuS 6545bf7938 Added back accidentially removed unit test 2014-08-06 12:08:18 +02:00
PKEuS d3a567bf96 Fixed false positive #5824: Variables that might be used for va_start() must not be passed by reference. 2014-08-06 12:06:36 +02:00
PKEuS adcc8b1634 Implement support for __attribute__((used)) (#3408) 2014-08-06 11:13:58 +02:00
PKEuS 8da61ab71a Refactorized CheckAssert::assertWithSideEffects():
- Removed crap
- Error message on calling non-const member function in assert()
- Fixed false positive #5311 and TODO_ASSERT
2014-08-06 10:15:48 +02:00
PKEuS fd5ff1bb8b Fixed false positive #6030: inheriting classes is not a variable declaration. 2014-08-06 09:04:03 +02:00
PKEuS 83a80cebeb Fixed order of simplifications (#6029) 2014-08-06 08:39:23 +02:00
PKEuS 8130fda4ae Implemented support for C++11 uniform initialization in several checks. 2014-08-05 16:11:42 +02:00
PKEuS f3e0df7501 Support C++11 style initialization with {}:
-> Support in setVarId and SymbolDatabase (#4344)
-> Fixed false positives in unused variable checking (#5491, #5494)

Side-effect: Support global variables initialized with brackets (C++03 style) in SymbolDatabase
2014-08-05 15:33:57 +02:00
PKEuS f5730a7d12 Flush stdout after putchar('.') to ensure that the characters are printed immediately as a progress indicator. 2014-08-05 13:22:40 +02:00
PKEuS bcf3a1e9e1 Refactorization: Moved code out of macro TEST_CASE 2014-08-05 12:55:46 +02:00
PKEuS d3501e77a8 Moved several tests from testclass.cpp to testconstructors.cpp, fixes test failure introduced recently. 2014-08-05 12:19:52 +02:00
PKEuS 804e055eee New check: initialization by itself in initializer list (#3982)
Refactorizations:
- Rearranged code in checkclass.cpp to increase readability
- Several fixes for testclass.cpp tests.
2014-08-05 11:50:08 +02:00
Daniel Marjamäki 9eb28cb8af ValueFlow: Improved analysis of assignments 2014-08-05 08:28:46 +02:00
Daniel Marjamäki a2f776b1b7 Dead pointer: Added checking for dead pointer usage when pointer alias local variable that has gone out of scope. 2014-08-05 06:24:23 +02:00
Daniel Marjamäki d35ce5f0db ValueFlow: Better handling of calculated function arguments in valueFlowSubFunction 2014-08-04 12:31:04 +02:00
Daniel Marjamäki 344016f7ab ValueFlow: Handle string values in valueFlowSubFunction 2014-08-04 12:13:15 +02:00
PKEuS ac59485e7e Refactorized CheckAutoVariables::assignFunctionArg():
- Splitted message into style message (assigning non-pointers) and warning message (assigning pointers)
- Support operator++/-- (#4793)
2014-08-04 11:45:24 +02:00
PKEuS 4a3d719386 Fixed recently introduced FP when C-Style casting nullpointers 2014-08-04 11:42:14 +02:00
PKEuS 4c80ca4e8e Improved cstyleCast check:
- Detect casting of literals
- Check initializer lists (#3630)
2014-08-04 11:21:25 +02:00
Daniel Marjamäki 47a2b35e98 BufferOverrun: Use ValueFlow string values more 2014-08-04 08:25:10 +02:00
Daniel Marjamäki 79fc549de0 ValueFlow: start adding valueflow handling of strings and pointer aliases 2014-08-03 20:11:22 +02:00
PKEuS 57c055fcc4 Fixed false negative #5985: default argument values should not affect variable usage checking. 2014-08-03 19:13:37 +02:00
PKEuS a6da71e598 Visual Studio: Use testsuite.h as precompiled header
-> Reduces build time of project testrunner by 13 seconds (16%)
2014-08-02 18:14:23 +02:00
PKEuS e486e8cc62 Updated WiX installer and VS solution to VS12 and Qt5 2014-08-02 11:52:37 +02:00
Daniel Marjamäki a943a0739a Tokenizer: Don't remove struct member in Tokenizer::simplifyKeyword() 2014-08-01 17:19:08 +02:00
Daniel Marjamäki f908959196 ValueFlow: improved analysis in for loops to avoid fp 2014-08-01 16:12:57 +02:00
Daniel Marjamäki 544a5957e1 Token: Added utility function getStrSize as a complement to getStrLength 2014-08-01 13:12:18 +02:00
Daniel Marjamäki 57c2e928d1 ValueFlow: Simple multivariable control flow analysis to avoid FP when 'control variable' is used 2014-08-01 07:35:15 +02:00
PKEuS 95afa51b24 Fixed crash #5991: Don't crash when lambda is incomplete
Fixed crash #6004: Support struct initializations in AST
2014-07-31 23:15:36 +02:00
Daniel Marjamäki 5de1e35350 CheckBufferOverrun: Fixed minsize checking of string literals. Check sizeof string instead of strlen. 2014-07-30 20:35:21 +02:00
Daniel Marjamäki 25846cf223 ValueFlow: Fix for if/else valueflow analysis 2014-07-30 18:12:33 +02:00
Daniel Marjamäki e8451b5d91 add missing flag. this testcase should only run in non-simplified mode. 2014-07-30 12:18:47 +02:00
Daniel Marjamäki 473b1bdb2b Multicondition: Fixed FP when using dynamic_cast 2014-07-30 11:23:09 +02:00
Daniel Marjamäki fdfea717c6 Suspicious string comparison: Refactoring using AST. Fixed FP in Lac. 2014-07-28 14:27:35 +02:00
Robert Reif 90bc59e0fa Fixed #6009 (Detect type mismatch in printf-like function when type is returned) 2014-07-28 09:16:35 +02:00
Daniel Marjamäki 76020d2ad0 astIsFloat: expression 'floatvar ? 0x40 : 0' is not float 2014-07-26 09:09:58 +02:00
Daniel Marjamäki 328cc7b8f5 Fixed #5996 (false positive: Clarify calculation precedence for '+' and '?'.) 2014-07-19 18:29:53 +02:00
Daniel Marjamäki af2b94e322 Fixed #5826 (Change error message for 'throw in destructor' check) 2014-07-19 03:29:50 +02:00
Daniel Marjamäki 2cc31acabb Fixed #5922 (FP: passedByValue for std::string::value_type) 2014-07-18 15:51:59 +02:00