Commit Graph

8312 Commits

Author SHA1 Message Date
Daniel Marjamäki 621c1e59c6 --project: handle SolutionDir and ProjectDir. This is a partial fix for #7791. custom build macros are still not handled. 2016-11-11 16:22:14 +01:00
Daniel Marjamäki 4de5dc75aa Fixed #7807 (false positive: (error) Signed integer overflow for expression 'int32_max-1'.) 2016-11-07 22:29:40 +01:00
Daniel Marjamäki 1245f1d621 Unused Functions: Fix checking when --cppcheck-build-dir is used. 2016-11-07 21:49:58 +01:00
Daniel Marjamäki ac7b351d1e ValueFlow: Don't calculate x<<64 and x>>64 2016-11-06 20:40:58 +01:00
Daniel Marjamäki dd69d5eabe ValueFlow: Don't calculate result when there is UB 2016-11-06 17:42:01 +01:00
Daniel Marjamäki 483fd8682a cleanup redundant info in comment. ticket numbers can be looked up with git blame. if the code says there is a syntax error then a comment that says 'invalid code' isn't much clarification. 2016-11-06 16:49:25 +01:00
Alexander Mai ee11f0974a #7769 segmentation fault at setTokenValue() on invalid code. 2016-11-06 14:20:58 +01:00
Daniel Marjamäki b607e83648 Try to fix travis 2016-11-05 21:45:31 +01:00
Daniel Marjamäki 350e5a7142 UnusedFunctions: Perform checking using analyzeinfo 2016-11-05 21:26:56 +01:00
Frank Zingsheim 19706b3464 Fix #7789 (Missing error messages in repeated check on compile_commands.json in cppcheck-gui) 2016-11-05 20:14:01 +01:00
Daniel Marjamäki ece4b1a06f Fix ValueFlow 2016-11-05 09:59:48 +01:00
Daniel Marjamäki f280061ff8 signed int overflow: warn about intmax+1 2016-11-05 09:29:52 +01:00
Daniel Marjamäki 2885a75ea6 ValueFlow: handle ~ in setTokenValue 2016-11-05 09:29:22 +01:00
Matthias Krüger 13bfe873f6 resolve mismatching tag reported by clang4.0-dev
was:

In file included from lib/checkunusedfunctions.cpp:21:
lib/checkunusedfunctions.h:114:15: warning: struct 'FunctionDecl' was previously declared as a class [-Wmismatched-tags]
    std::list<struct FunctionDecl> _functionDecl;
              ^
lib/checkunusedfunctions.h:108:23: note: previous use is here
    class CPPCHECKLIB FunctionDecl {
                      ^
lib/checkunusedfunctions.h:114:15: note: did you mean class here?
    std::list<struct FunctionDecl> _functionDecl;
              ^~~~~~
              class
1 warning generated.
2016-11-04 15:51:36 +01:00
orbitcowboy 919f8ac323 Fixed typos. There are no real changes. 2016-11-04 15:01:05 +01:00
Daniel Marjamäki 223ce04986 Merge pull request #841 from zingsheim/FunctionParameter
Function parameter
2016-11-01 21:58:52 +01:00
Daniel Marjamäki 0e9810b7f6 CheckStl: validation of iterators returned from functions 2016-11-01 14:08:42 +01:00
Frank Zingsheim d4f01583b6 Fixed TODO (check if function parameter is non-const reference etc..) by common function 2016-11-01 14:06:30 +01:00
Matthias Krüger 892a81055d CheckUnusedFunctions::analyzerInfo(): remove unused parameter 'filename'.
Was:

lib/checkunusedfunctions.cpp: In member function ‘std::__cxx11::string CheckUnusedFunctions::analyzerInfo(const string&) const’:
lib/checkunusedfunctions.cpp:292:67: warning: unused parameter ‘filename’ [-Wunused-parameter]
 std::string CheckUnusedFunctions::analyzerInfo(const std::string &filename) const
                                                                   ^~~~~~~~
2016-11-01 13:34:26 +01:00
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
Frank Zingsheim a91c54df72 Remove unused enums ValueFlow::Value::ValueKind::Max and ValueFlow::Value::ValueKind::Min 2016-10-30 09:44:52 +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