Commit Graph

8292 Commits

Author SHA1 Message Date
Frank Zingsheim 34e8ed6e31 Fix travis; fix [lib/checkunusedfunctions.h:110]: (style) Class 'FunctionDecl' has a constructor with 1 argument that is not explicit. 2016-11-01 11:18:03 +01:00
Daniel Marjamäki e77d76525e CheckUnusedFunction: generate better analyzerinfo 2016-10-31 20:43:57 +01:00
orbitcowboy 4e3fdedff9 templatesimplifier: Improved const correctness. There are no functional changes. 2016-10-31 17:24:15 +01:00
orbitcowboy 2f8a24764f tokenize: Improved const correctness. There are no functional changes. 2016-10-31 17:18:27 +01:00
orbitcowboy b3c60bf6b2 tokenize: Improved const correctness. There are no functional changes. 2016-10-31 16:11:11 +01:00
orbitcowboy a81920cae1 checkunusedvar: Check pointer against NULL before dereferencing it. 2016-10-31 15:57:34 +01:00
Daniel Marjamäki 2c3232affa cppcheck-build-dir: Use settings and cppcheck version in checksum so results will be recalculated if cppcheck is upgraded or there is significant changes on the command line. 2016-10-29 22:40:44 +02:00
orbitcowboy bc32ccc894 CheckUninitVar::isFunctionParUsage: Avoid implicit conversion from type bool to int. 2016-10-29 21:41:55 +02:00
orbitcowboy 960a0c6b11 Token: Improved const correctness of findsimplematch() and findmatch(). There are no functional changes. 2016-10-29 21:37:45 +02:00
Daniel Marjamäki e76710c906 Revert "Revert "Fix potential uninitialized variable in Tokenizer::simplifyTypedef""
It does not _fix_ any potential uninitialized variable. So I reverted this. However I think that as a refactoring it was ok.

This reverts commit 5b2e4891c4.
2016-10-29 19:04:10 +02:00
Daniel Marjamäki d092631645 Disable VS warnings 2016-10-29 18:32:39 +02:00
Daniel Marjamäki 5b2e4891c4 Revert "Fix potential uninitialized variable in Tokenizer::simplifyTypedef"
This reverts commit bed2f66302.
2016-10-29 18:29:05 +02:00
Daniel Marjamäki 7001aa1e81 Try to fix VS errors about std::to_string() 2016-10-29 18:18:29 +02:00
Frank Zingsheim bed2f66302 Fix potential uninitialized variable in Tokenizer::simplifyTypedef 2016-10-29 17:05:51 +02:00
Daniel Marjamäki 26cae60110 Try to fix VS compile error. Add analyzeinfo.cpp. 2016-10-29 16:20:20 +02:00
Daniel Marjamäki 75f50e0bf8 try to fix VS compile error for std::uint32_t 2016-10-29 15:55:03 +02:00
Daniel Marjamäki faa32fd51d Fix Cppcheck warnings and remove Travis suppressions 2016-10-29 15:50:08 +02:00
Daniel Marjamäki a860c4c231 refactoring checksum calculations for --cppcheck-build-dir 2016-10-29 15:35:31 +02:00
Daniel Marjamäki eeee630f77 fix cppcheck warnings 2016-10-29 12:35:14 +02:00
Daniel Marjamäki 9ff3e85899 Added --cppcheck-build-dir flag 2016-10-29 12:18:11 +02:00
Daniel Marjamäki 324f68ca36 rename function 2016-10-28 12:10:19 +02:00
Daniel Marjamäki 9c1a08ca84 move std function information from checkstl to std.cfg 2016-10-27 19:24:24 +02:00
Daniel Marjamäki 0b76aa0f24 checkstl: refactoring. make data static instead of anonymous. 2016-10-27 18:54:15 +02:00
Daniel Marjamäki 892596681b Try to make Travis happy 2016-10-27 11:53:37 +02:00
Daniel Marjamäki f6a5f6bb61 CheckStl::mismatchingContainers: Refactoring, use Library instead of hardcoding 2016-10-27 10:25:45 +02:00
Harald Scheidl 0de47f709e Fixed #7755 (false positive: member variable is not initialized in the constructor) 2016-10-26 10:39:53 +02:00
Robert Reif 4216b26b8c Fixed #7775 (crash at valueFlowSetConstantValue) 2016-10-26 10:36:02 +02:00
Daniel Marjamäki 08a618c476 Library: Add <iterator> element in <function> <arg>. Not used by any checks yet. 2016-10-25 23:07:18 +02:00
Daniel Marjamäki f973a9a9d5 SymbolDatabase: Refactoring handling of library-function return type 2016-10-23 23:20:36 +02:00
Daniel Marjamäki c8f831b70d Library: Allow that type of function return is specified. Fixes #7668. 2016-10-23 23:04:15 +02:00
Robert Reif f25d205999 Fixed #7767 (SymbolDatabase: function not analysed when unknown macros are in front of function definition) 2016-10-22 22:29:18 +02:00
Daniel Marjamäki 8a0f3009ff ValueFlow: inner and outer function return values 2016-10-22 17:22:57 +02:00
Daniel Marjamäki 77cd6c194f ValueFlow: Set 'known' property for function return values 2016-10-22 12:24:15 +02:00
Daniel Marjamäki 86a620a3b4 ValueFlow: Better handling of function return value when there are 0 parameters 2016-10-20 16:10:55 +02:00
Daniel Marjamäki a85eacc157 cstyleCast: don't warn about '(const Variable *)nullptr' 2016-10-18 22:56:33 +02:00
Daniel Marjamäki efa3aba32a Remove Tokenizer::simplifyNull() 2016-10-18 21:44:02 +02:00
Daniel Marjamäki 9cea2d6dfa Tokenizer: Removed simplifications of standard functions that should be handled through configuration. 2016-10-18 19:25:58 +02:00
Dmitry-Me d2e667ae7b Put apostrophes consistent with other similar messages 2016-10-18 15:45:08 +03:00
Daniel Marjamäki fae4a4dacf Fixed #7668 (ValueFlow: return value from abs) 2016-10-17 13:05:19 +02:00
Daniel Marjamäki 1b7766c7bd astyle formatting 2016-10-16 19:03:14 +02:00
Daniel Marjamäki 90ed7634b8 MathLib: fix for octal char literal '\200' 2016-10-16 13:42:20 +02:00
Daniel Marjamäki 5175bf88d6 Platform: Fix type limits calculations. sizeof=>bit 2016-10-16 12:00:33 +02:00
Daniel Marjamäki c70987b727 ValueType: fix type of integer literals 2016-10-16 11:36:22 +02:00
Daniel Marjamäki 7fb812f415 Fixed #7752 (ValueFlow: no conditional value, probably because condition is in ternary operator and/or in function call.) 2016-10-16 07:15:28 +02:00
Daniel Marjamäki ad74421526 Fixed #7756 (ValueFlow: fix bug in valueAfterAssign, same variable in lhs and rhs) 2016-10-15 19:09:50 +02:00
Daniel Marjamäki d09a8dde57 Improved char literal handling. In the 'normal' tokenlist these should not be simplified to integer literals. 2016-10-12 10:20:24 +02:00
Miika-Petteri Matikainen 26816ed954 Fixes preprocessor regression causing hang
Cppcheck 1.76 introduced a regression in preprocessor which causes
the following code to hang:

    $ cat > test.c << EOF
    #ifndef Y
    #else
    #endif
    EOF
    $ cppcheck -D BAR --force test.c
    Checking test.c ...
    ^C

This used to work with version 1.75. Git bisect reveals that this
regression was caused by commit:
ff036c8742

This commit fixes the regression by avoiding infinite loop in
hasDefine(). If cfg is empty string "", we can skip the whole loop
and exit early.
2016-10-11 19:56:13 +03:00
orbitcowboy fe08abb76f Improved Doxygen comments. There are no functional changes. 2016-10-11 13:51:46 +02:00
PKEuS 1715969f6f Support prefix-increment/decrement in CheckAutoVariables::assignFunctionArg() (#3177) 2016-10-10 21:34:40 +02:00
PKEuS 1227a3f596 Improved check: Complain if a variable is modified but not used again 2016-10-10 21:27:40 +02:00