Daniel Marjamäki
dc37034687
Merge pull request #917 from x29a/unique_includes
...
Unique includes
2017-06-23 20:21:38 +02:00
neheb
ef86ac04b4
Add OpenCL support
...
OpenCL is basically C99.
2017-06-22 17:34:07 -07:00
x29a
b3a747d606
fix brainfart
2017-06-22 16:53:13 +02:00
x29a
cde17935ea
only use each include path once
2017-06-22 16:49:36 +02:00
Daniel Marjamäki
1e12ec241c
reuse simplecpp::simplifyPath
2017-06-21 14:27:46 +02:00
Daniel Marjamäki
f86d8244fa
Fixed #8022 (DacaWrongData: checkIgnoredReturnValue, hana)
2017-06-10 08:23:26 +02:00
Daniel Marjamäki
453058c059
AST: Better handling of C++11 initializer lists
2017-06-09 22:35:46 +02:00
Daniel Marjamäki
fd74d455ce
AST: Better handling of case
2017-06-08 15:32:35 +02:00
Daniel Marjamäki
da87fdbb90
Refactoring TemplateSimplifier::simplifyCalculations, Token::Match patterns
2017-06-08 08:18:40 +02:00
Daniel Marjamäki
c1ea873e1c
TemplateSimplifier::simplifyCalculations: Add some more tests and make sure they pass
2017-06-08 08:15:05 +02:00
Daniel Marjamäki
cb48e63f92
TemplateSimplifier: Fixed bug in simplifyCalculations. Now template58 test case does not throw InternalError
2017-06-08 00:49:46 +02:00
Daniel Marjamäki
d2e7df2c04
TemplateSimplifier: Broke out code into separate function
2017-06-08 00:16:43 +02:00
Daniel Marjamäki
2740736136
Avoid 'deleteThis' in TemplateSimplifier::simplifyCalculations as it can cause 'use after free' see #6021
2017-06-07 20:09:06 +02:00
Daniel Marjamäki
d335412858
Avoid 'deleteThis' in TemplateSimplifier::simplifyCalculations as it can cause 'use after free' see #6021
2017-06-07 19:46:02 +02:00
Daniel Marjamäki
18abe4a142
Fixed #6021 (TemplateSimplifier::simplifyCalculations causes heap corruption on invalid code)
2017-06-07 19:32:56 +02:00
Daniel Marjamäki
60e36492e2
Refactoring, renamed local variable
2017-06-07 12:37:44 +02:00
Alexander Mai
ce13b75967
Add missing types to Platform::platformString(). Add another pattern to Tokenizer::findGarbageCode() to avoid potential crash in Valueflow
2017-06-06 22:15:11 +02:00
Stas Cymbalov
ff38cc5c13
Set struct size cutoff in passedByValue check to 2*sizeof_pointer
...
Struct arguments are either pushed to the stack or passed in the
registers. Since both methods operate on machine words it is logical to
tie the maximum size of a struct argument that doesn't trigger
passedByValue diagnostic to the size of the machine word.
Also guessed size of STL classes is set to 3*sizeof_pointer, this better
represents reality and ensures that structs containing them will still
trigger passedByValue.
2017-06-06 08:48:11 +02:00
Daniel Marjamäki
3b805e7001
fix testrunner (WRONG_DATA usage)
2017-06-05 18:49:20 +02:00
Daniel Marjamäki
150d2aa902
Refactor and rename CHECK_WRONG_DATA
2017-06-05 18:41:15 +02:00
Daniel Marjamäki
62c22a8e06
daca2: change output for DacaWrongData. Show location. And use severity 'debug'
2017-06-04 19:46:20 +02:00
Daniel Marjamäki
66a488586e
Temporarily readd the UNSTABLE configuration
2017-06-04 18:30:49 +02:00
Daniel Marjamäki
20b27cfd51
avoid some WrongData warnings
2017-06-04 18:27:42 +02:00
Daniel Marjamäki
0c6a551039
Try to limit Daca2WrongData output a little
2017-06-04 16:41:30 +02:00
Daniel Marjamäki
9715164d0a
Fixed DACA2 CHECK_WRONG_DATA macro
2017-06-04 15:50:27 +02:00
Daniel Marjamäki
35348fcf98
Try to fix Travis
2017-06-04 14:46:57 +02:00
Daniel Marjamäki
1439b08fbd
Fixed -DDACA2 compiler errors
2017-06-04 14:14:42 +02:00
Daniel Marjamäki
2106099029
daca2: print error message (DacaWrongData) instead of crashing when wrong data is seen
2017-06-04 14:05:34 +02:00
Daniel Marjamäki
26bd863d0a
Fixed #7724 (hang: long expression => wrong AST)
2017-06-04 12:16:49 +02:00
Daniel Marjamäki
b8ee500d45
Fixed #7092 (Invalid style error: Variable not assigned a value)
2017-06-03 15:31:29 +02:00
Daniel Marjamäki
ccb2f2ce6a
astyle formatting
...
[ci skip]
2017-06-03 15:30:36 +02:00
Daniel Marjamäki
bbde3cc23a
Merge pull request #910 from mathbunnyru/asalikhov/improve_readability
...
improve readability
2017-06-03 14:33:21 +02:00
Daniel Marjamäki
aeef7117fe
astyle formatting
...
[ci skip]
2017-06-03 11:34:30 +02:00
Daniel Marjamäki
7ec3715c57
check.h: Cppcheck will be stable by default. Use -DUNSTABLE to make it unstable.
2017-06-03 11:18:00 +02:00
uburuntu
f4ce49d883
ENH: perfomance: using clear() and empty() more faster for stl containers
2017-06-02 22:38:00 +04:00
Ayaz Salikhov
f5646183cd
Move comment to the right place
2017-06-02 17:15:24 +03:00
Alexander Mai
b4a58be113
#define HIDE_WRONG_DATA to get release mode build (hiding crashes on invalid AST/symboldatabase). Fix doxygen syntax.
2017-06-01 23:38:02 +02:00
Daniel Marjamäki
b68c8d91ab
Fixed #8039 (Tokenizer: wrong simplification of string)
2017-06-01 22:21:02 +02:00
Daniel Marjamäki
bce0776417
Fixed #7795 (ValueFlow: Value is not known after conditional increment )
2017-06-01 15:16:07 +02:00
Daniel Marjamäki
5efb2e3be0
Visual Studio: Skip unknown platforms (ARM, ARM64)
2017-06-01 13:13:23 +02:00
Ayaz Salikhov
132c0af22a
Simplify some statements
2017-06-01 02:02:12 +03:00
Ayaz Salikhov
3cd2f2d092
Don't cast bool to bool
2017-06-01 01:49:40 +03:00
Ayaz Salikhov
cb58cf8163
.length() > 0 == !.emepty()
2017-06-01 01:42:29 +03:00
Daniel Marjamäki
1f48b082d1
CLI: Add --output-file flag so results can be written to file directly.
2017-05-30 15:04:28 +02:00
Ville Skyttä
5ab158fec2
Spelling fixes
2017-05-30 08:03:15 +03:00
Daniel Marjamäki
1961d6d0f7
CppCheck: make sure preprocessor syntax errors are reported
2017-05-28 20:34:58 +02:00
Sam Truscott
956b5812e7
Fixed #7866 (Crash while scanning QML files)
2017-05-28 16:39:18 +02:00
Steve Browne
b58562fc7d
Added test cases for catching when assignment comes after an operator, compound assignment, or comparison for ticket #7429 and fixed the tests.
2017-05-28 16:00:06 +02:00
Daniel Marjamäki
18adb97873
astyle formatting
...
[ci skip]
2017-05-28 15:56:26 +02:00
Frank Zingsheim
aa937e426d
Fixed #7849 (Tokenizer: Wrong simplification of floating point equality comparison)
2017-05-28 10:53:50 +02:00
amai
624ceb5027
Fix includes for cygwin
2017-05-27 10:23:06 +02:00
Ayaz Salikhov
28aa939d69
iwyu - include what you use
2017-05-27 04:33:47 +02:00
uburuntu
d41d091c07
ENH: perfomance: seeking of one char is more efficiently
2017-05-27 04:15:54 +02:00
amai
45ba1ff1e3
#8079 SymbolDatabase::createSymbolDatabaseEnums() crashes on invalid enum declaration
2017-05-25 09:50:14 +02:00
Daniel Marjamäki
1dd42d9a9e
arrayIndexOutOfBounds: Make sure error message is clarified for daca2 --template format
2017-05-25 08:18:37 +02:00
Daniel Marjamäki
0262020707
--template: Removed 'clang' and renamed 'cppcheck2' to 'daca2'
2017-05-25 05:24:42 +02:00
Daniel Marjamäki
dda5556ded
Fixed #8034 (AST: better handling for c++ type initialization)
2017-05-24 20:24:56 +02:00
Daniel Marjamäki
5444875f89
Fixed #8034 (AST: better handling for c++ type initialization)
2017-05-24 20:18:31 +02:00
Daniel Marjamäki
099b4435c3
Fixed #8074 (Preprocessor::getConfigs: wrong configuration extracted 'A;B;;')
2017-05-24 11:16:41 +02:00
Daniel Marjamäki
93e0516291
Fixed #8009 (Tokenizer: fix handling of template rvalue references)
2017-05-23 18:55:17 +02:00
Daniel Marjamäki
70c2de62b7
arrayIndexOutOfBounds: better note
2017-05-23 16:06:32 +02:00
Daniel Marjamäki
6e1544bd49
ValueFlow: Use getOrdinalText()
2017-05-23 15:01:56 +02:00
Daniel Marjamäki
e73657b198
Clarify arrayIndexOutOfBounds
2017-05-23 14:58:43 +02:00
Daniel Marjamäki
a3c0eecccf
Added --template=cppcheck2 output format
2017-05-23 12:19:11 +02:00
Daniel Marjamäki
6cb563b3fe
ErrorLogger: Adjust the severity in the 'clang' output format. as far as I know, clang severities are 'fatal error', 'error' and 'warning'.
2017-05-23 12:02:57 +02:00
Daniel Marjamäki
d3d3d31613
Clarify 'invalidFunctionArg' messages
2017-05-23 11:57:25 +02:00
Daniel Marjamäki
f7cda81c0c
Refactoring: ValueFlow::Value::errorSeverity() will have the logic if value is 'error' or 'warning'
2017-05-23 11:43:56 +02:00
orbitcowboy
ba2b235e24
Fixed: warning: ‘tokvalue’ may be used uninitialized in this function [-Wuninitialized].
2017-05-22 15:22:38 +02:00
orbitcowboy
ffe6582e6b
Added platform support for Atmel AVR 8 bit microcontrollers.
2017-05-22 14:46:19 +02:00
Daniel Marjamäki
b59bd96c6d
ErrorLogger: Fix crash when error message does not have a FileLocation
2017-05-22 11:25:58 +02:00
Daniel Marjamäki
8ef9ab26b1
Clarify floatConversionOverflow
2017-05-22 11:04:24 +02:00
Daniel Marjamäki
0cb1c4f221
Clarify integerOverflow messages
2017-05-22 10:10:56 +02:00
Daniel Marjamäki
9374055238
ErrorPath: clarify the 'shiftTooManyBits' error message
2017-05-22 07:58:56 +02:00
Daniel Marjamäki
7af58cf31a
show full error path in xml files
2017-05-22 07:42:54 +02:00
Daniel Marjamäki
58da0df2f6
astyle formatting
...
[ci skip]
2017-05-20 18:52:48 +02:00
Daniel Marjamäki
82a372a380
Try to clarify ErrorPath texts
2017-05-20 08:47:35 +02:00
Daniel Marjamäki
55ae206ecc
ErrorPath: better output
2017-05-19 17:29:16 +02:00
Daniel Marjamäki
b53a2ff9eb
Command line: Added --template=clang formatting
2017-05-19 17:09:49 +02:00
Daniel Marjamäki
f92b16706c
ValueFlow: Add ErrorPath info after for loop
2017-05-19 16:32:58 +02:00
Daniel Marjamäki
2bb54fef69
ValueFlow: Test ErrorPath handling
2017-05-19 14:34:59 +02:00
Matthias Krüger
a2c716fa3b
CheckOther::checkDuplicateExpression(): be lazier if style-reports are not enabled. NFCI.
2017-05-19 00:54:55 +02:00
Daniel Marjamäki
899615c1e4
update simplecpp includes
...
[ci skip]
2017-05-18 22:26:07 +02:00
Matthias Krüger
aa3f1db33c
Add internal check that checks for redundant non-nullness checks in Token::(simple)Match checks.
...
In code like
if (tok && Token::simpleMatch(tok, "bla")) {}
or
if (tok->previous() && Token::Match(tok->previous(), "foo")) {},
the first check is redundant because Token::(simple)Match already checks if the argument token is null.
2017-05-18 22:12:33 +02:00
Daniel Marjamäki
9d08cbf4d2
Fix 'make checkcfg'
2017-05-18 22:10:08 +02:00
Daniel Marjamäki
340c687cbf
Revert "Use 'Stringification => Tokenizer' until some issues have been fixed"
...
This reverts commit c2727691a4
.
2017-05-18 21:53:25 +02:00
Daniel Marjamäki
040d2f0012
Use simplecpp lexer in test cases
2017-05-18 21:52:31 +02:00
Daniel Marjamäki
c2727691a4
Use 'Stringification => Tokenizer' until some issues have been fixed
2017-05-18 09:33:41 +02:00
Daniel Marjamäki
7bd0bc7534
Tokenizer: Simplify '->' to '.'
2017-05-17 22:50:54 +02:00
Daniel Marjamäki
bc12a0b21f
Handle empty token list better (for instance when Preprocessor::validateCfg() see problem)
2017-05-17 22:30:20 +02:00
Daniel Marjamäki
1f4b84379d
Fix for #pragma asm
2017-05-17 21:58:46 +02:00
Daniel Marjamäki
59335f80d2
Try to fix windows build. Reduce header dependencies
2017-05-17 15:38:31 +02:00
Daniel Marjamäki
90a952d8c2
Add col and info in plist
2017-05-17 15:22:51 +02:00
Daniel Marjamäki
6230919976
Skip 'Stringification => Tokenize' step
2017-05-17 14:57:54 +02:00
Daniel Marjamäki
67e3187653
Preprocessor: Refactor handling of #pragma asm
2017-05-17 10:25:37 +02:00
Daniel Marjamäki
cd53d10970
ErrorPath: More information about assignments
2017-05-16 23:12:35 +02:00
Daniel Marjamäki
ecb3f0a934
ErrorLogger: Write ErrorPath info in the xml report
2017-05-16 22:58:02 +02:00
Daniel Marjamäki
c617851567
ErrorLogger: Added ErrorPath where each item has token and info
2017-05-16 22:38:13 +02:00
Daniel Marjamäki
e65d6d3c67
ValueFlow: inherit Value::callstack in calculations
2017-05-16 19:43:55 +02:00
Daniel Marjamäki
f92e7b3bfc
Emit better errorpath in CheckBufferOverrun::negativeIndexError
2017-05-16 19:08:47 +02:00
Daniel Marjamäki
970ff181de
Show 'Possible' errors without --enable=warning
2017-05-16 17:51:45 +02:00
Daniel Marjamäki
6967d68137
Add --plist-output argument
2017-05-16 14:07:23 +02:00
Daniel Marjamäki
3ef2f825c7
Fixed Cppcheck warnings about null pointer dereference
2017-05-15 20:36:28 +02:00
Daniel Marjamäki
8d75d1b920
Partial fix for #8028 (ValueFlow: Origin/callstack of value)
2017-05-15 20:05:11 +02:00
PKEuS
3432257390
Removed deprecated command --append
2017-05-14 11:57:04 +02:00
PKEuS
fda1f67da6
Set version to 1.79.99/1.80 dev
2017-05-14 10:07:38 +02:00
PKEuS
fb94ad21fa
Updated Visual Studio solution to VS2017.
2017-05-14 10:04:25 +02:00
Daniel Marjamäki
45d998979c
CHECK_WRONG_DATA: switch to debug macro
2017-05-13 19:10:05 +02:00
Daniel Marjamäki
55cd69e290
alwaysTrueFalse: Dont warn when checking sizeof for some type. such condition might be platform dependent.
2017-05-13 19:07:24 +02:00
Daniel Marjamäki
e5e5a5e4b8
1.79: Set version
2017-05-13 11:25:16 +02:00
Daniel Marjamäki
95db173e77
Fixed Cppcheck warning
2017-05-13 11:06:33 +02:00
orbitcowboy
b9bac79a8c
Improved const correctness, there are no functional changes.
2017-05-12 16:20:47 +02:00
PKEuS
68d77b73da
SymbolDatabase: Fixed parsing of unnamed arguments, properly detect pointers ( #8052 )
2017-05-07 09:03:58 +02:00
PKEuS
28b8bc57a8
CheckVaarg::va_list_usage(): Bailout on "goto" ( #8043 )
2017-05-07 08:32:48 +02:00
PKEuS
b345c430fe
CheckStl::readingEmptyStlContainer(): Skip over lambdas ( #8055 )
2017-05-07 08:15:58 +02:00
Alexander Mai
c1cdcc158f
Run astyle. Fix some Doxygen issues
2017-05-06 11:57:02 +02:00
amai2012
3e11eb9dca
#8050 cppcheckError: 0xFFFFFFul -> 16777215ULU. Don't add a suffix 'U' if there is already a suffix present.
2017-05-05 14:47:58 +02:00
Daniel Marjamäki
a8a54bbfa8
Fixed #6028 (Improvement: False positive caused by C keywords in assembly comments)
2017-05-05 08:57:24 +02:00
Daniel Marjamäki
65297ce285
Fixed #7191 (false positive memleak on in-place new)
2017-05-04 19:39:57 +02:00
Alexander Mai
f54a6f085b
#7883 hang: CheckOther::checkFuncArgNamesDifferent() template code in .h. Activate language check for header files + Small refactoring
2017-05-03 20:36:26 +02:00
Daniel Marjamäki
1ec9b8c5b4
Fixed #8047 (false positive uninitialized variable - sizeof **A)
2017-05-03 19:27:55 +02:00
Alexander Mai
e88b4dcf06
Add another check to Tokenizer::validateC(): C++ casts
2017-05-03 16:57:42 +02:00
Matthias Krüger
a28f57344c
templatesimplifier: mark getTemplateNamePositionTemplateMember() static.
...
Fixes gcc 7-dev warning:
lib/templatesimplifier.cpp: In function ‘bool getTemplateNamePositionTemplateMember(const Token*, int&)’:
lib/templatesimplifier.cpp:715:6: warning: no previous declaration for ‘bool getTemplateNamePositionTemplateMember(const Token*, int&)’ [-Wmissing-declarations]
bool getTemplateNamePositionTemplateMember(const Token *tok, int &namepos)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2017-05-03 08:45:48 +02:00
Daniel Marjamäki
295e4fdfc2
Fixed #8049 (Preprocessor: Comment in system include not removed properly)
2017-05-02 22:18:24 +02:00
Alexander Mai
1bc7a89b3c
Improve search patterns within Tokenizer::validateC()
2017-05-02 17:57:06 +02:00
Robert Reif
e2bfe1c0ec
Fixed #8044 : Crash below SymbolDatabase::setValueType
2017-05-01 14:12:50 -04:00
Matthias Krüger
cee0f724ff
Fixed #8018 : Tokenize::findGarbageCode: detect heads of for-loops with 1 or more than 2 semicolons as garbage code.
2017-05-01 18:28:26 +02:00
Daniel Marjamäki
bc7799dccd
Fixed #7888 (false positive from knownConditionTrueFalse with sizeof(int) == sizeof(long))
2017-05-01 12:23:28 +02:00
Daniel Marjamäki
f51a709f80
add fixme comment
2017-05-01 11:25:58 +02:00
Daniel Marjamäki
ce6cc5416a
uninitvar: made ValueFlow check experimental
2017-05-01 11:13:30 +02:00
Daniel Marjamäki
9cdda53fb9
CheckFunctions::memsetZeroBytes: Add CHECK_WRONG_DATA to avoid crashes
2017-04-30 18:58:51 +02:00
Daniel Marjamäki
8a08cc0796
Fixed #8029 (Tokenizer::simplifyCAlternativeTokens: dont simplify 'eb.and + 1')
2017-04-30 14:40:41 +02:00
Daniel Marjamäki
7fd04cd8d0
Updated Token::expressionString(), write '->' instead of '.'
2017-04-30 14:22:18 +02:00
Simon Martin
28960a8bba
Remove bailout and fix varid for template class member initialized in out-of-line constructor ( #8031 )
2017-04-30 08:59:47 +02:00
IOBYTE
8a668aa860
Add missing else that could cause an extra try scope to be added to the scope list ( #8025 )
...
Add an optional extended description…
2017-04-30 08:58:41 +02:00
Daniel Marjamäki
980ca39fe2
valueFlowForward: better handling of sizeof() in rhs in assignments
2017-04-29 08:25:55 +02:00
Garrett Bodily
ddfd4c6348
Write access type of functions and variables to xml dump
2017-04-29 07:18:16 +02:00
Robert Reif
964b744c96
Fixed #7990 (crash: SymbolDatabase::printOut())
2017-04-29 07:02:49 +02:00
Daniel Marjamäki
06102cb3d7
UninitVar: Don't warn for inconclusive values
2017-04-28 21:09:56 +02:00
Daniel Marjamäki
a0a8f8ddd6
ValueFlowUninit: make it more strict
2017-04-28 13:29:09 +02:00
Daniel Marjamäki
5fd77d2518
Switch CHECK_WRONG_DATA macro so crashes/hangs are avoided
2017-04-28 10:48:41 +02:00
Daniel Marjamäki
589fabd0b1
Fixed #8027 (hang after AST_MAX_DEPTH is exceeded in array initialization)
2017-04-27 20:53:27 +02:00
Daniel Marjamäki
d9f72d5f8c
AST: Handle 'x = { [ID] = 1, .. }' when ID is unexpanded macro
2017-04-26 22:35:04 +02:00
Daniel Marjamäki
bdf16b1157
Tokenizer::simplifyComma: dont simplify comma in '=(struct s){...}'
2017-04-26 20:48:08 +02:00
Daniel Marjamäki
89532cf8b9
Fixed #7968 (valueFlowBeforeCondition: better handling of compound assignments)
2017-04-25 20:45:02 +02:00
orbitcowboy
537045b176
Improved const correctness. There are no functional changes.
2017-04-25 14:57:48 +02:00
Daniel Marjamäki
140e086206
Fixed #7738 (False positive deallocret - delete and return NULL pointer)
2017-04-24 22:05:16 +02:00
Daniel Marjamäki
37fd60e879
Fixed #7293 (Use of uninitialized pointer not detected (worked in 1.71))
2017-04-24 18:27:16 +02:00
Daniel Marjamäki
9a294496c1
ValueFlow::setTokenValue: Fix typo
2017-04-23 21:59:58 +02:00
Daniel Marjamäki
a688402617
ValueFlow::setTokenValue: Don't calculate parent value for uninitialized values
2017-04-23 21:58:01 +02:00
Daniel Marjamäki
2f51b975ed
valueFlowUninit: only check variables
2017-04-23 21:50:51 +02:00