7351 Commits

Author SHA1 Message Date
Robert Reif
66cacde3db Fixed #7513 (value flow of array dimension with enum doesn't always work) 2016-05-26 11:25:50 +02:00
Daniel Marjamäki
50352c8d69 Fixed #3552 (Don't warn about missing ctor for class inside union) 2016-05-25 19:05:16 +02:00
PKEuS
c7b3836379 Small refactorizations:
- Optimized performance of several functions by adding pre-checks
- Simplified some code
- Fixed VS warning in testsymboldatabase.cpp
2016-05-25 15:30:49 +02:00
PKEuS
8c0eab3eb3 Optimization: Improved performance of CheckBufferOverrun::checkScope() when dealing with a large number of arrays (#5975)
-> checking time decreases from 1010s to 50s on the code snippet in #5975
-> Dropped a garbage code unit test
2016-05-25 14:42:00 +02:00
Daniel Marjamäki
ae97f53244 Fixed #6184 (ValueType: overloaded < operator) 2016-05-25 13:56:36 +02:00
Matthias Krüger
0556edd151 fix #7505 (crash on invalid code) 2016-05-25 13:14:34 +02:00
PKEuS
f2ae295f1e Support char literals in CheckCondition::checkIncorrectLogicOperator() (#5912) 2016-05-24 15:08:48 +02:00
Daniel Marjamäki
06a594a9e0 Fixed #6207 ('not' misinterpreted as alternative C token) 2016-05-24 13:33:21 +02:00
Daniel Marjamäki
397480f929 Fixed #7376 (ValueType: wrong type for container element) 2016-05-23 18:53:59 +02:00
Daniel Marjamäki
37afc57a2a Fixed #7455 (Suppressions: not working well with windows path separators) 2016-05-23 15:38:47 +02:00
PKEuS
4bb99a7887 Improved CheckSizeof::checkSizeofForPointerSize():
- Support cast in front of malloc() call
- Support sizeof(type) pattern (#4428)
2016-05-22 22:29:52 +02:00
Daniel Marjamäki
710e066a9a Fixed #6406 (VarId: struct member initialization) 2016-05-22 21:18:52 +02:00
PKEuS
64d2fd2f57 Added new attribute "arg" to <alloc> and <dealloc> to specify the argument that is allocated/deallocated.
This fixes several issues with allocation functions in windows.cfg, such as HeapAlloc() and VirtualAllocEx() (#7503)
2016-05-22 17:19:14 +02:00
PKEuS
851c6e0ed5 Improved buffer overflow checking for scanf: %c with a width (#3494) 2016-05-22 14:00:26 +02:00
Daniel Marjamäki
06d5e73e88 Fixed #7471 (Tokenizer::prepareTernaryOpForAST: typedef with comma inside ?:) 2016-05-22 11:33:21 +02:00
Daniel Marjamäki
b7b92b2140 Fixed #6674 (false positive 'unusedPrivateFunction' - calling virtual function in subclass) 2016-05-21 20:07:35 +02:00
Daniel Marjamäki
c23c1f245c Fixed #6989 (incorrect memleak error) 2016-05-21 14:03:28 +02:00
Alexander Mai
d492500f34 #5844 False positive: returnReference fp for inner lambda function 2016-05-20 23:46:56 +02:00
orbitcowboy
b1b0c920e3 Removed sprintf_s from windows.cfg. 2016-05-19 08:22:40 +02:00
orbitcowboy
46adf180d7 cfg: Added support for fopen_s and sprintf_s functions. Fixed a wrong tests. 2016-05-18 09:31:26 +02:00
Alexander Mai
303a85a930 #4195 segmentation fault of cppcheck (invalid code). Fix segfault which turned up after refactoring the enum handling code. 2016-05-17 22:19:23 +02:00
Alexander Mai
4f77a2b044 #7500 buffer overflow: encodeMultiChar lib/mathlib.cpp:343. Improve errors handling 2016-05-17 20:43:32 +02:00
Daniel Marjamäki
7453b641bd Fixed #4839 (Variable (in array) is assigned a value that is never used) 2016-05-17 16:03:55 +02:00
Daniel Marjamäki
99fc13ee70 Fixed #6968 (unusedPrivateFunction not correct, called by inner class) 2016-05-16 20:52:50 +02:00
Daniel Marjamäki
65998f1d7c CheckClass: previous change introduced false positives when Token::function() is wrong. Avoid those false positives. 2016-05-16 10:55:22 +02:00
Daniel Marjamäki
bce15b1ade CheckClass: refactored the code, use symboldatabase instead of name comparisons when possible, fixed a FN. 2016-05-16 09:36:26 +02:00
amai2012
22542e7547 Merge pull request #794 from simartin/ticket_7452
Ticket #7452: Properly interpret escape sequences in character literals.
2016-05-15 20:35:50 +02:00
Daniel Marjamäki
2668cee3cf Fixed #6397 (FP deallocuse - conditional deallocation and conditional return) 2016-05-15 20:27:44 +02:00
Simon Martin
3af30e728c Ticket #7452: Properly interpret escape sequences in character literals. 2016-05-15 15:48:24 +02:00
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
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
Kamil Dudka
efe98883ab checkleakautovar: do not miss 'throw' followed by :: 2016-05-13 21:37:49 +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
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
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
a167a2d242 TestSymbolDatabase: Add some tests for the new enum handling 2016-05-09 18:34:24 +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
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
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
b26dd1ccab ValueFlow: Handle enums 2016-05-07 20:18:07 +02:00
Daniel Marjamäki
be90080976 Fixed #7481 (False positive AssignmentAddressToInteger - pointer to enum) 2016-05-07 19:51:37 +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