Commit Graph

7265 Commits

Author SHA1 Message Date
Edoardo Prezioso 40aa326065 Tokenizer: remove redundant 'done' condition, related to ticket #3409.
Add more possible letters to simplifyInitVar patterns.
Replace 'tokAt(1)' with 'next()' and 'linkAt(1)' with 'next()->link()'.
Little optimizing improvements to simplifyAsm.
2011-12-13 22:41:38 +01:00
Daniel Marjamäki 458fa0874a Uninitialized variables: Started writing a new check. Ticket: #3369 2011-12-13 21:57:27 +01:00
PKEuS c9f5117cf5 Fixed #3407 (False positive: (inconclusive) Found duplicate branches for if and else. (inline assembler)) 2011-12-13 21:42:38 +01:00
Daniel Marjamäki 34fba9e1ea Fixed #3405 ((error) Invalid number of character ({) when these macros are def ined: 'WIN32'.) 2011-12-13 21:14:41 +01:00
Edoardo Prezioso 4cad5d4df4 Workaround fixes to shut up some cppcheck '--inconclusive' whinings. 2011-12-13 00:24:34 +01:00
Edoardo Prezioso 81a2e62abd Tokenizer::simplifyGoto: fix another memory read error reported by Valgrind.
Also improvements to Tokenizer are done.
2011-12-12 22:03:25 +01:00
Edoardo Prezioso 79b82f115f Tokenizer: some changes to line numbers of some tokens:
simplifyAsm: change line number of newly added 'asm ( )' in order to be the same as next ';'.
simplifyIfAddBraces: Change line number of newly added '}' in order to be the same as next 'else', except for '{ ; } else'.
2011-12-12 20:55:25 +01:00
Reijo Tomperi dc59fc4391 astyle fix 2011-12-12 21:27:48 +02:00
Daniel Marjamäki c8f497a9b3 Fixed #3405 ((error) Invalid number of character ({) when these macros are def ined: 'WIN32'.) 2011-12-12 19:35:25 +01:00
Daniel Marjamäki 5eb8ab70e3 Fixed #3401 (Run cppcheck on cppcheck source code before release) 2011-12-12 18:45:52 +01:00
Edoardo Prezioso 626f13ae7e Tokenizer: Fix another Valgrind error in simplifyErrNoInWhile. Add more jumping patterns to simplifyIfAddBraces and simplifyDoWhileAddBraces. 2011-12-12 13:15:35 +01:00
Daniel Marjamäki 5f5c912f3f temporary fix for inconclusive false warnings. there is not sufficient logic for determining when there is NOT a pointer dereference. 2011-12-12 07:43:33 +01:00
Daniel Marjamäki 2dbe7ca196 CheckNullPointer::isPointerDeRef: Skip inconclusive checking when --inconclusive hasn't been given. 2011-12-12 07:35:53 +01:00
Edoardo Prezioso 99d8ce3732 Fix Valgrind error in arraySize():
if there's code like: 'int [ ] a = { 1 , 5 , }', 'end' is last '}', when 'tok2' arrives to second ',' and cppcheck finds out that next token to 'tok2' is '}', remove this ',' with 'tok2->deleteThis()' but it causes (maybe) a memory corruption to 'end' which will gave problems later because 'tok' will be assigned to it or its next token.
2011-12-12 02:23:49 +01:00
Edoardo Prezioso 52620e6493 Tokenizer::simplifyDoWhileAddBraces:
1)rewrite fix for ticket #988 (just don't simplify inside macro parenthesis);
2)use a different organization of the code: start from last token and proceed backwards. This way 'simplifyDoWhileAddBracesHelper' can be called just once, hence the 'Helper' code can be improved and moved in the main function.
2011-12-12 00:20:46 +01:00
Edoardo Prezioso cf574072b6 Tokenizer::arraySize(): improve code structure, fixed 'tok2' for-looping which didn't stop to the ending '}' parenthesis. 2011-12-11 23:13:37 +01:00
Edoardo Prezioso 6506b2c016 Oops. Fix testrunner fail. 2011-12-11 20:36:56 +01:00
Edoardo Prezioso 3c098839d1 simplifyIfAddBraces: Remove restriction for jumping opening parenthesis '(' as a fix to #2873, because even without this the original test case doesn't crash anymore. Add more jumping patterns.
simplifyFunctionParameters: Add more jumping patterns and an observation related to error message for equal parameter names, help needed.
Fix grammar mistake in comment.
2011-12-11 13:07:13 +01:00
Daniel Marjamäki ffb5d107be CheckNullPointer::isPointerDeRef: Tweaks to reduce false warnings when inconclusive is used. 2011-12-11 08:48:55 +01:00
Daniel Marjamäki 497c54a1a7 Fixed #3168 (false negative: buffer overflow in subfunction) 2011-12-11 08:16:58 +01:00
Edoardo Prezioso 27801b35eb Other improvements to tokenizer code.
Handle SQL code better, even when there's no ';' after 'EXEC SQL'.
simplifyVarDecl: Check with 'Token::Match' once when you have to check a pattern inside which there should be a number or a variable. Use '%any%' and after that check if that string is a number or a variable name later.
simplifyGoto: process also anonymous structs and unions which should have 'indentspecial' incremented, skip code like 'var = { ... }'.
2011-12-11 02:02:38 +01:00
Edoardo Prezioso 5134964026 Fix code in commit 5f522fb841 and reapply it again. 2011-12-10 23:49:56 +01:00
Reijo Tomperi 11242e4045 Fix spelling error: explicitely -> explicitly 2011-12-10 22:58:45 +02:00
Daniel Marjamäki 04159b81b8 reverted 5f522fb841, to avoid hang in TestBufferOverrun::arrayInfo 2011-12-10 20:51:36 +01:00
Daniel Marjamäki ee39f6402c reverted fix for #3168, I'll rewrite it 2011-12-10 20:46:10 +01:00
Daniel Marjamäki 897e8637b4 Fixed #3168 (false negative: buffer overflow in subfunction) 2011-12-10 19:26:12 +01:00
Edoardo Prezioso 5f522fb841 Tokenizer: improve code and remove redundant checks.
In particular: improve 'double sharp' concatenation by handling also code which begins without the [{};]. Do the same with C# code. Also, in the labels simplification function, skip also '{}' when the open bracket is after a '='.
2011-12-10 18:45:27 +01:00
Daniel Marjamäki e870c68978 Check64BitPortability: Wiki formatting update 2011-12-10 18:41:09 +01:00
Daniel Marjamäki c5a1b5ecab --doc : don't write internal checks in the doc output 2011-12-10 18:39:25 +01:00
Daniel Marjamäki caa45f549d htdocs: updated download link to 1.52 installer 2011-12-10 17:58:15 +01:00
Edoardo Prezioso bf815ac1e4 Improve labels simplification code, remove redundant checking. 2011-12-10 14:13:48 +01:00
Daniel Marjamäki 9b901b35f3 createrelease: updated username in commands 2011-12-10 14:10:07 +01:00
Daniel Marjamäki 3d5539a7dc Makefile: Set debug mode 2011-12-10 13:02:03 +01:00
Daniel Marjamäki 6f2bbc0ba6 1.52: Updated Makefile 2011-12-10 13:00:45 +01:00
Daniel Marjamäki f58d023753 1.52: Updated Changelog 2011-12-10 12:56:36 +01:00
Daniel Marjamäki 93b447f7f6 1.52: Updated version 2011-12-10 12:55:40 +01:00
PKEuS 9fc7453917 Memory leaks: Code cleanups 2011-12-10 11:55:14 +01:00
Daniel Marjamäki 8624c0b9fd Merge pull request #67 from makulik/master
Fixed ticket #3389 '-U option doesn't supress include file handling for #include statements inside #ifdef code paths'
2011-12-10 02:44:01 -08:00
Daniel Marjamäki c2e86b867c Fixed #3386 (Syntax Error: 'int a[]={b<c?1:2,3};') 2011-12-10 11:34:27 +01:00
Edoardo Prezioso 51c1e2303f CheckBufferOverrun::checkInsecureCmdLineArgs(): Remove recently unused variable 'pattern'. 2011-12-09 23:24:08 +01:00
PKEuS 91a0a071d0 Take symbol database into use or improve its usage in some checks. 2011-12-09 23:28:10 +02:00
makulik 0a777dcb52 Fixed ticket #3389 '-U option doesn't supress include file handling for #include statements inside #ifdef code paths'
Signed-off-by: makulik <g-makulik@t-online.de>
2011-12-09 21:57:06 +01:00
PKEuS 9b685ba3c3 Code cleanup 2011-12-09 21:00:57 +01:00
Edoardo Prezioso 7d12951da0 1)Fixed ticket #3184 (Improve Tokenizer: improve simplifyMulAnd to simplify weirder code);
2)Fix a test case inside TestSimplifyTokens::flowControl.
2011-12-09 20:47:51 +01:00
PKEuS f46cf5fd65 Exception safety: refactorings, use the symbol database 2011-12-09 19:53:00 +01:00
Daniel Marjamäki 8ca8887849 C++ Builder : Fixed compiler error 2011-12-08 22:24:09 +01:00
Daniel Marjamäki b383bae4ab C++ Builder: Fixed compiler errors 2011-12-08 22:17:50 +01:00
Daniel Marjamäki 6029e23189 Preprocessor: Use const_iterator instead of iterator where possible 2011-12-08 22:14:11 +01:00
Daniel Marjamäki 60d828e778 C++ Builder: Fixed compiler error 2011-12-08 22:09:03 +01:00
PKEuS 167a7e3e51 Various code cleanups 2011-12-08 21:28:34 +01:00