Commit Graph

4249 Commits

Author SHA1 Message Date
Edoardo Prezioso 4d38dd4f2c Add testcase for Tokenizer::simplifyVarDecl.
A branch was not executed in coverity, but there was a testcase which needed it.
2012-11-04 23:49:23 +01:00
Edoardo Prezioso 71150e987d Add testcase related to commit 0d26a79f2c.
cover up the case when there's at least a token before 'namespace %type% { }'.
2012-11-04 23:14:41 +01:00
Edoardo Prezioso 24bf6f99e1 More simplifyRedundantParenthesis changes:
simplify also '( var . var . ... . var )' parenthesis.
2012-11-04 22:38:18 +01:00
Edoardo Prezioso 87c931b74b Add '%char%' as pattern to match in Token::Match.
All and only those single characters enclosed in "'" are accepted.
2012-11-04 16:58:18 +01:00
Andrew Martin 7c370ec873 Fixed #4305 (improve check: 'vector.size() < 1' should result in 'inefficient checking for '...' emptiness.') 2012-11-04 16:15:26 +01:00
PKEuS 4cd96158ae Fixed parsing of "__asm__ volatile {""};" 2012-11-04 12:21:34 +01:00
PKEuS b0c1c2c819 Don't suggest using initialization list for static variables (#4332) 2012-11-04 11:59:09 +01:00
PKEuS e44ee280bc Fixed handling of pointers to functions in namespace as template parameters (#4172) 2012-11-04 11:15:03 +01:00
PKEuS 9cb9388e49 Fixed handling of pointers in templates (#4319) 2012-11-04 10:49:25 +01:00
PKEuS 6122819832 Message refactorization: Changed expression "0-terminate" to "null-terminate" as discussed on 24b98feadb 2012-11-03 21:21:19 +01:00
PKEuS 1c399c86ca Improved fix for #4311; Added back support for "this." (fixes again #4291)
Added TODO unit test for missing varid.
2012-11-03 21:16:05 +01:00
Daniel Marjamäki 6c2563c467 Fixed #4311 (False positive: warning (selfAssignment): Redundant assignment of 'm_bar' to itself. 2012-11-03 13:18:43 +01:00
Daniel Marjamäki 24e71c479c Fixed #4301 (htmlreport broken) 2012-11-03 11:25:40 +01:00
PKEuS a36e008967 Fixed #4314: Using CheckNullPointer::isPointerDeRef() here is overkill and doesn't work as intended, since this function is designed to return 'false' if it isn't sure. 2012-11-03 10:25:32 +01:00
PKEuS 472a39d157 Fixed two MSVC warnings in testsymboldatabase.cpp 2012-11-01 18:55:15 +01:00
PKEuS 24b98feadb Message refactorization: checkuninitvar.cpp, checkunusedfunctions.cpp, checkunusedvar.cpp 2012-11-01 18:40:20 +01:00
Robert Reif 8e14d7682c Symbol database: fix some function prototype bugs that were found during check conversions. Ticket: #4266 2012-10-30 15:48:06 +01:00
Daniel Marjamäki e1dce66494 tweaked message 2012-10-28 13:03:40 +01:00
Daniel Marjamäki 38213f1f2f Fixed #4237 (False positive: (error) Memory Leak: data (assign reference variable value to a shadow variable in inner scope)) 2012-10-27 16:36:14 +02:00
Daniel Marjamäki 863441afe8 Fixed #4236 (False positive: pointer free()d twice - neglecting call to other function) 2012-10-25 19:41:18 +02:00
Daniel Marjamäki e7483af028 Opposite inner conditions - made check 'experimental' because there are unsolved false positives. 2012-10-21 18:18:29 +02:00
Baris Demiray 0e100f7563 Fixed #4189 (Improve check (printf('%l') not detected)) 2012-10-21 08:50:29 +02:00
Edoardo Prezioso f0f216390e Fixed #4276 (segmentation fault of cppcheck (invalid code)) 2012-10-20 21:40:51 +02:00
Alexander Mai 1881898e67 Added unit test for #4290 2012-10-19 20:04:43 +02:00
Edoardo Prezioso 4ddcde1e6f CheckMemoryLeak: add '?1:0' to clarify the value of the argument to 'deleteNext'; Tokenize.cpp: in simplifyCompoundAssignment(), remove ':' odd code used to fix a weird test case ('case' code not inside a function body), remove useless 'tok->next() != NULL' check (already true by previous condition); in simplifyConditionOperator(), handle better the parenthesis skipping code and remove useless ')'check; in simplifyQuestionMark(), remove useless 'tok->tokAt(-2)' check (Token::Match returns false if the token is NULL), add more patterns to Token::Match to handle more test cases; in simplifyBitFields(), add 'const' to 'offset' bool. RedirectOutputError: style nitpick change to declaration of a pointer. 2012-10-19 14:19:52 +02:00
Baris Demiray d84d360afc Fixed #4291 (Variable ID is not set when variable is accessed through 'this') 2012-10-19 06:18:13 +02:00
Edoardo Prezioso 61365ea0e5 Fixed #4293 (FP: Variable is not simplified, causing a false positive). 2012-10-17 00:25:20 +02:00
Daniel Marjamäki b591097c87 Revert "Fixed #3190 (SymbolDatabase: Parse of sub class constructor fails)"
This reverts commit 1ee980184e.
2012-10-16 19:12:27 +02:00
Robert Reif 1ee980184e Fixed #3190 (SymbolDatabase: Parse of sub class constructor fails) 2012-10-16 06:11:28 +02:00
Daniel Marjamäki 562291477d Fixed #4226 (False positive: Uninitialized variable (problem with namespace ::rtl)) 2012-10-15 06:53:38 +02:00
Daniel Marjamäki be174d6266 TemplateSimplifier: Fixed bad pattern that was detected by CheckInternal and pointed out by edward-san. The handling of recursive templates is better now. 2012-10-14 19:48:53 +02:00
Robert Reif 0d4b87c71e SymbolDatabase: Improved find function functionality. Taking arguments into account 2012-10-14 17:30:37 +02:00
PKEuS 2aae8381cc Message refactorization: checkstl.cpp 2012-10-14 11:16:48 +02:00
Edoardo Prezioso 64b4960acc Tokenizer: simplify GCC '({ %var%|%num% ; })' to '%var%|%num%'.
Remove useless brace around condition in simplifyFlowControl.
2012-10-13 13:24:41 +02:00
Edoardo Prezioso 1951d1cdc5 Tokenizer: improve the new 'skipTernaryOp' function by supporting GCC '{(var|num;)}' statement expression extension; improve 'Tokenizer::simplifyQuestionMark' by supporting simplification with 'case' before ternary operation, using skipTernaryOp to get colon and, most importantly, supporting indented '?:' operations. 2012-10-13 02:32:43 +02:00
Edoardo Prezioso d4a3c1617a Fixed: Tokenizer::simplifyLabelCaseDefault was careless with '?:' operator near 'case' adding the semicolon after the ternary colon. 2012-10-12 20:51:13 +02:00
XhmikosR 8d08c3b58b pro and pri files: remove unneeded empty lines, use spaces for consistency 2012-10-12 17:46:57 +02:00
Edoardo Prezioso c42facae1f Tokenizer::simplifyLabelsCaseDefault: jump '(' and '[' parenthesis.
TestTokenizer: add simple test cases with some correct and wrong syntax concerning 'case'.
2012-10-12 17:08:21 +02:00
Edoardo Prezioso e62e03ab31 Fixed #4267 (segmentation fault of cppcheck (invalid code)). 2012-10-09 20:44:30 +02:00
Ettl Martin 2cf75d5339 astyle run 2012-10-08 21:50:21 +02:00
Ettl Martin 0879bb5825 #4245: Segmentation fault (invalid code); Applied patch from amai. 2012-10-08 21:49:25 +02:00
Daniel Marjamäki f74c30e116 Fixed #4231 (False positive: (error) Returning/dereferencing 'ptr' after it is deallocated / released (ignoring goto)) 2012-10-08 17:23:47 +02:00
Daniel Marjamäki 61183e7896 astyle formatting 2012-10-08 16:23:05 +02:00
Daniel Marjamäki fefd8529c6 Fixed #4007 (False positive: 'Possible null pointer dereference' when using short-circuit evaluation) 2012-10-07 19:06:49 +02:00
Daniel Marjamäki 6a37942431 Fixed #3935 (False report for accessing array out of bounds after casting to short) 2012-10-07 18:38:05 +02:00
Alexander Mai 3656366c7e Fixed #4257 (False Positive: String literal compared with variable - for non-pointer variable) 2012-10-07 16:26:03 +02:00
Daniel Marjamäki 0115bb8d24 Fixed #4102 (False positive: 'find('=') + 1U' can't be replaced with compare) 2012-10-07 12:43:14 +02:00
Daniel Marjamäki 4c1abde48e Reverted 107b3b44. Write syntax error for 'if MACRO()'. We can't know if MACRO() is supposed to be used in the condition or if it is some annotation that should be removed. Ticket #4171 2012-10-06 19:12:39 +02:00
Edoardo Prezioso e3bbcf501f Fixed #4234 (segmentation fault of cppcheck in Tokenizer::simplifyFlowControl() (invalid code)) 2012-10-06 13:37:44 +02:00
Daniel Marjamäki c2b61030a8 Fixed #4254 (Tokenizer::simplifyIfAssign: varids not preserved) 2012-10-06 12:49:24 +02:00