Commit Graph

14834 Commits

Author SHA1 Message Date
Alexander Mai 9d1302d523 #7490 sizeof('a') should be sizeof(int) in C mode. Previous fix was hardcoding 4 for C. 2016-05-14 22:52:43 +02:00
Alexander Mai 4816394511 #5970 false positive in Uninitialized variable: d - casting struct var to char*. It got fixed since 1.72, add regression test 2016-05-14 22:36:54 +02:00
Daniel Marjamäki 2cb03b3fd0 Fixed #7409 (Tokenizer: Links not set properly 'Data<T&&>') 2016-05-14 20:40:30 +02:00
Daniel Marjamäki 7591a57587 Removed redundant valuetype debug output 2016-05-14 20:11:57 +02:00
Daniel Marjamäki 5a1bea2a09 Fixed #7244 (False memory leak when POD is allocated with value initialization and pushed onto container) 2016-05-14 14:56:51 +02:00
Alexander Mai 251fc022fa #7490 sizeof('a') should be 4 in C mode 2016-05-14 13:05:44 +02:00
amai2012 60efae147f Merge pull request #792 from boos/cwe-mapping-3
CWE mapping of selfAssignment, wrongmathcall, unpreciseMathCall, memsetZeroBytes, memsetFloat, memsetValueOutOfRange, clarifyCalculation, clarifyStatement
2016-05-14 12:26:33 +02:00
Roberto Martelloni afa8ad0ebe CWE mapping of selfAssignment, wrongmathcall, unpreciseMathCall, memsetZeroBytes, memsetFloat, memsetValueOutOfRange, clarifyCalculation, clarifyStatement 2016-05-14 10:13:33 +01:00
Kamil Dudka efe98883ab checkleakautovar: do not miss 'throw' followed by :: 2016-05-13 21:37:49 +02:00
Robert Reif 5631c765a7 SymbolDatabase: better handling when array size is given with expression involving enum constants. 2016-05-13 11:40:19 +02:00
Daniel Marjamäki 1d21cf5755 Tokenizer::setVarId: Refactoring, use continue in loops 2016-05-12 18:58:24 +02:00
Daniel Marjamäki 372763c85e Tokenizer: Refactoring, split up the big Tokenizer::setVarId() function 2016-05-12 18:20:20 +02:00
Daniel Marjamäki b04285514f Tokenizer: Refactoring; use early return 2016-05-12 15:51:30 +02:00
Daniel Marjamäki df6a66deed SymbolDatabase: Add test that makes sure enum constant values are calculated properly. Related with ticket #7493. 2016-05-12 12:07:40 +02:00
Daniel Marjamäki 613311cc57 Fixed #7493 (enumMismatch on Enum declaration) 2016-05-12 11:46:08 +02:00
Robert Reif 97bbb7da0d Fixed #7476 (SymbolDatabase: Wrong data with single ; in line) 2016-05-12 11:35:02 +02:00
Daniel Marjamäki 99d0dbf39c Tokenizer::setVarId: Refactoring, changed type name 2016-05-11 21:12:29 +02:00
Daniel Marjamäki b965cf5491 Fixed #7444 (Tokenizer::varId: Wrong varid when there is anonumous union in class) 2016-05-11 20:43:23 +02:00
Daniel Marjamäki bf8471e109 Fixed #7491 (Questionable enumMismatch) 2016-05-11 15:33:59 +02:00
amai2012 3a6e33d58e Add python 2.7+ requirement (see https://github.com/danmar/cppcheck/pull/751) 2016-05-11 11:58:05 +02:00
Daniel Marjamäki fb5e6d8a7d Fixed #6960 (New check: enum variable is assigned mismatching value) 2016-05-10 20:22:35 +02:00
Daniel Marjamäki f0fcb859c7 Tokenizer: use static keyword instead of anonymous namespace for variables 2016-05-10 16:17:52 +02:00
Daniel Marjamäki 98626e5a46 rundaca2.py: The START is an index 2016-05-10 11:00:57 +02:00
Daniel Marjamäki a167a2d242 TestSymbolDatabase: Add some tests for the new enum handling 2016-05-09 18:34:24 +02:00
amai2012 3dea23c99e Use new signature Tokenizer::createTokens 2016-05-09 17:14:51 +02:00
amai2012 d7d98689dd Merge pull request #791 from gleydsonsoares/ucontext_OpenBSD
fix build on OpenBSD
2016-05-09 16:48:46 +02:00
Daniel Marjamäki 8a13b5cd83 Fix Cppcheck warning 2016-05-09 13:08:00 +02:00
Daniel Marjamäki 9c8922541e Avoid C++11 for-range to make AppVeyor happy 2016-05-09 13:05:08 +02:00
Robert Reif 381fa53ec6 SymbolDatabase: better handling of enum values 2016-05-09 12:40:56 +02:00
Daniel Marjamäki eac3660f46 ValueType: Changed type info for enums to 'signed int', that is what checks wants to see mostly. 2016-05-09 11:11:13 +02:00
Gleydson Soares 99a03b4d2a fix build on OpenBSD 2016-05-08 19:48:20 -03:00
Daniel Marjamäki 1caa79c45f Tokenizer::simplifyPointerConst: Remove simplification. Its purpose was to avoid crash for garbage code (#6900). This fixes #7485. 2016-05-08 21:32:34 +02:00
Daniel Marjamäki e99a9b4742 SymbolDatabase: Fix cleanup (avoid dead pointers) 2016-05-08 18:34:23 +02:00
Daniel Marjamäki 6f1af2cf0a ValueType: Set ValueType info in simplified token list 2016-05-08 17:57:26 +02:00
Daniel Marjamäki 7edb1bc2e2 Fixed #7484 (ValueType: crash with --debug --verbose) 2016-05-08 17:43:34 +02:00
Daniel Marjamäki e355e4ac78 ValueType: Refactoring 2016-05-08 17:42:53 +02:00
Daniel Marjamäki 803b4d4cf8 ValueType: Better handling of nested types 2016-05-08 14:55:10 +02:00
Daniel Marjamäki 636e97c272 ValueType: Improved debug output for nested types 2016-05-08 13:15:20 +02:00
Daniel Marjamäki f0953c6916 ValueType: better handling of nonstandard types 2016-05-08 11:55:25 +02:00
Daniel Marjamäki b94eaeca6a ValueFlow: For convenience, return constant folded value 2016-05-08 11:17:10 +02:00
Daniel Marjamäki b26dd1ccab ValueFlow: Handle enums 2016-05-07 20:18:07 +02:00
Daniel Marjamäki ad2d3394c8 Tokenizer: Create syntax tree before creating symboldatabase 2016-05-07 19:56:28 +02:00
Daniel Marjamäki be90080976 Fixed #7481 (False positive AssignmentAddressToInteger - pointer to enum) 2016-05-07 19:51:37 +02:00
Matthias Krüger 9bcb36e0bb dmake: disable -Wsign-promo 2016-05-07 19:38:40 +02:00
Jérémy Lefaure 08d8b2da38 git-pre-commit-cppcheck: check only added or modified source files
The regexp is written according to git-diff-index manual.
2016-05-07 19:09:13 +02:00
Alexander Mai 4e9afac92f Update Makefile. Replace another NULL by nullptr 2016-05-07 17:35:00 +02:00
amai2012 eba1b0881d Minor refactoring: use nullptr (instead of 0/NULL), change signature of Tokenizer::createTokens 2016-05-07 16:30:54 +02:00
PKEuS 5d5886b464 Properly detect binary & in CheckCondition::clarifyCondition() (fixes false positives when self-checking cppcheck) 2016-05-06 17:39:41 +02:00
PKEuS 896582ce56 Fixes for CheckStl::string_c_str():
- Fixed false positive #7480
- Fixed false negative: Show performance message also for non-local objects
2016-05-06 17:25:00 +02:00
PKEuS 3366a74bb0 Refactorized CheckCondition::clarifyCondition():
- Reimplemented parts of the check based on ValueType
- Merged two loops

Fixed some type conversion messages
2016-05-06 15:22:45 +02:00