Edoardo Prezioso
8e90ad106c
Fixed ticket #3148 (Analysis failed on "Modules/mathmodule.c")
...
Fix: Do not handle code when 'return' is inside a macro. This is valid also for 'switch' code inside a macro.
2011-10-05 19:33:46 +02:00
Edoardo Prezioso
3c370dcfdf
Fixed #3146 "Analysis failed" error on softmagic.c:
...
-Fixed: the code didn't check the rightness of the switch syntax if it was inside another switch;
-Tweaked: removed the two bool variables, so now the conditions take count of indentation unsigned variables.
2011-10-04 12:16:39 +02:00
Edoardo Prezioso
bc74213036
Fixed #3132 (Analysis failed. If the code is valid then please report this failure.)
2011-10-03 19:38:37 +02:00
Daniel Marjamäki
417dc1ff2a
Fixed #3159 (Uninitialized variable false positive)
2011-10-02 20:38:58 +02:00
Daniel Marjamäki
480c403511
Fixed #3125 (FP: Possible null pointer dereference in conditional operator)
2011-10-02 19:27:18 +02:00
Daniel Marjamäki
b2d0e48a31
Fixed #3126 (false positive: Null pointer dereference)
2011-10-02 18:24:45 +02:00
Kimmo Varis
4ef4cb26e9
CLI: Add support for ignoring case in PathMatch.
...
In Windows (or in Windows code?) we want to ignore case in the
paths. This patch implements the case ignore for the PathMatch-
class.
2011-10-02 11:46:27 +03:00
Robert Reif
65b0fb4519
fix #3153 (false positive buffer access out-of-bounds)
2011-09-30 17:28:59 -04:00
Robert Reif
272783347b
another variation of false negative from #3149
2011-09-30 16:26:08 -04:00
Robert Reif
1dcb8b2382
really fix #3149 (false negative: Technically the member function 'A::f' can be const.)
2011-09-30 11:16:34 -04:00
Kimmo Varis
70b153cc1e
Disable fileListStdin test from testcmdlineparser.
...
That test hangs the test run.
2011-09-30 08:35:23 +03:00
Robert Reif
556d523e4f
fix #3149 (false negative: Technically the member function 'A::f' can be const.)
2011-09-29 20:16:52 -04:00
Robert Reif
ac942c6684
fix #3151 (missing portability warning for extra qualifier on destructor)
2011-09-29 19:25:14 -04:00
Robert Reif
4d12372b65
run astyle
2011-09-29 19:23:30 -04:00
Kimmo Varis
24ce170554
Merge pull request #37 from joshbeck/master
...
Added support for reading file lists from stdin, correctly this time
2011-09-29 10:50:37 -07:00
Robert Reif
092ba0b1de
fix symbol database bug where function variable type of a nested class was not found
2011-09-28 22:05:26 -04:00
Reijo Tomperi
236d0eb178
Fix #2813 (False negative: Uninitialized variable not found for realloc)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/2813
Patch provided by: marekzmyslowski
2011-09-28 21:46:09 +03:00
Robert Reif
540207533b
fix #3008 (New check: Order of initialisation list)
2011-09-27 21:07:37 -04:00
Joshua Beck
15cb2a0c61
Merge remote-tracking branch 'upstream/master'
2011-09-27 18:43:09 -05:00
Robert Reif
44a926aa4d
add a few more Microsoft TCHAR function conversions
2011-09-27 07:29:36 -04:00
Joshua Beck
9583394eba
Fix test and add info to -h output.
2011-09-27 01:02:58 -05:00
Robert Reif
ec377d24eb
add support for Microsoft TCHAR character constants
2011-09-26 22:08:24 -04:00
Joshua Beck
87cff36f9d
Updated manual and added test for reading file list from stdin.
2011-09-26 20:43:39 -05:00
Robert Reif
2d717d77cd
reduce false negatives for checking for CheckOther::checkSignOfUnsignedVariable()
2011-09-26 21:24:34 -04:00
Robert Reif
6e8bf43dc0
add some Windows TCHAR scanf and printf conversions
2011-09-25 10:02:27 -04:00
Robert Reif
545aa9e55b
start adding Windows wide character support
2011-09-24 16:02:56 -04:00
Robert Reif
f97424b242
start adding Windows ASCII TCHAR conversion support
2011-09-24 14:51:03 -04:00
seb777
424f349b88
fix #3121 ([False Positive] Incorrect obsoleted functions)
2011-09-24 10:54:58 +02:00
Robert Reif
a685f1f5b7
add operator support to ertra qualification check
2011-09-23 19:45:19 -04:00
Robert Reif
ac070b90f2
fix for loop false positives when zero length arrays present
2011-09-22 21:23:40 -04:00
Robert Reif
97d4277854
add Microsoft memory function conversions to standard cstring functions
2011-09-22 19:59:56 -04:00
Robert Reif
1dc7c0edf9
fix #3127 ([False positive] _tmain function i VS 2010 project)
2011-09-21 20:16:20 -04:00
Robert Reif
5e329d7280
fix typo in last commit
2011-09-21 19:55:11 -04:00
Robert Reif
de0f2dc1d0
add test case for false negatives introduced by fix for 3106
2011-09-21 07:32:23 -04:00
Robert Reif
4d1dda10fa
add some more windows type conversions
2011-09-20 20:17:02 -04:00
Daniel Marjamäki
1a7511ed48
Fixed #3106 (False positive: Uninitialized variable check has inconsistent behavior with ternary operator)
2011-09-20 21:00:05 +02:00
Robert Reif
af5272dfb0
only simplify Microsoft MFC code when Windows platform is selected
2011-09-20 07:20:37 -04:00
Robert Reif
e234e8cc5b
add some common windows pointer type conversions to standard types
2011-09-19 23:14:58 -04:00
Robert Reif
b349d36c50
fix #3124 (FP: Buffer access out-of-bounds when memset two dimension array (a[5][6]))
2011-09-19 20:32:50 -04:00
Robert Reif
be660003ec
start adding conversions from common Windows types to standard types
2011-09-18 13:06:54 -04:00
Daniel Marjamäki
96a04eee9c
Merge pull request #35 from simartin/ticket_3059
...
Ticket 3059: Report the correct line number in unused functions warnings
2011-09-18 08:15:28 -07:00
Robert Reif
66eb37c135
convert size_t to standard type
2011-09-18 10:31:31 -04:00
Robert Reif
3e35ea0972
fix sizeof long double for unix64 for #2888 (Allow defining sizes of base types)
2011-09-18 08:40:08 -04:00
Simon Martin
b493e4bf7b
Ticket 3059: Report the correct line number in unused functions warnings
2011-09-18 07:13:39 +02:00
Robert Reif
b5d22fda0d
fix #2888 (Allow defining sizes of base types)
2011-09-17 19:40:52 -04:00
Simon Martin
ba2591b002
Take into account kimmov's review comments
2011-09-17 16:55:59 +02:00
Simon Martin
21a4999c1b
Make the build warning clean with clang++
2011-09-17 14:40:17 +02:00
Robert Reif
1717bda382
fix wrong information about constness of function
2011-09-16 18:07:25 -04:00
Robert Reif
cce4303f28
fix a problem with Qt slots immediately followed by signals
2011-09-16 16:59:43 -04:00
Robert Reif
2bc7da2c64
quick fix for #3114 (infinite recursion when operator= is overloaded)
2011-09-14 19:04:06 -04:00
Kimmo Varis
288efd832c
Tests: Add more commandlineparser tests.
...
Add commandlineparser tests for giving two suppressions. Giving
two suppressions in one parameter is not yet supported so it is
todo-test.
2011-09-13 17:55:00 +03:00
Edoardo Prezioso
1ff7410f4f
Fixed #3075 (False positive => Improve tokenizer: remove redundant code after a 'return' state)
2011-09-13 07:55:47 +02:00
Robert Reif
302daeb9bd
add test for #3110 (false positve: style) Boolean result is used in bitwise operation. Clarify expression with parentheses)
2011-09-12 20:46:00 -04:00
seb777
f3193ef611
Remove invalid test case.
...
The code does not compile. In addition, it's a "todo test case".
2011-09-12 19:38:38 +02:00
Robert Reif
3f517b5f23
partial fix for #2960 (false negative: buffer access out of bounds)
2011-09-11 21:51:05 -04:00
Robert Reif
40009d091d
add multi-dimension array support to second checkScope and use it for member arrays
2011-09-11 20:42:57 -04:00
Robert Reif
0d6592dd2e
use correct checkScope function in CheckBufferOverrun for single dimension member arrays
2011-09-11 19:21:13 -04:00
Robert Reif
19928e26d1
refactor to unify functionally identical code in CheckBufferOverrun::checkScope()
2011-09-11 14:00:53 -04:00
Daniel Marjamäki
55230baf78
Fixed #3086 (false positive: Boolean result is used in bitwise operation.)
2011-09-11 09:46:01 +02:00
Daniel Marjamäki
9a97fbe022
Fixed #3104 (unread despite modified and used in IF statement)
2011-09-11 08:19:35 +02:00
seb777
8ed0e3a239
Revert "The case statement requires constant-expression (C, C++, C# and Java."
...
This reverts commit 5879fe419d
.
2011-09-11 00:44:40 +02:00
seb777
5879fe419d
The case statement requires constant-expression (C, C++, C# and Java.
...
Needless to simplify the calculation of a piece of code that can not compile.
2011-09-10 17:28:32 +02:00
Robert Reif
794fdd056b
Merge branch 'master' of github.com:danmar/cppcheck
2011-09-10 10:14:49 -04:00
Robert Reif
547a79d4fe
calculate array size for variable length structures with array at end in CheckBufferOverrun::checkStructVariable() when possible
2011-09-10 10:14:32 -04:00
Philipp Kloke
2f62d180fe
Fixed #1740 (Undefined Behavior: Divide by zero)
2011-09-10 16:12:53 +02:00
seb777
08efad13b2
fix #3093 (Simplify code (math expression) with keywords 'return' and 'case')
2011-09-10 13:28:54 +02:00
Robert Reif
b0eab2587d
better detection of variable sized structure in CheckBufferOverrun::checkStructVariable()
2011-09-09 08:37:24 -04:00
Robert Reif
27bfa2a346
fix some CheckBufferOverrun::checkStructVariable() flase negatives for possible variable length structs
2011-09-09 07:46:06 -04:00
Robert Reif
4a71693e0c
Merge branch 'master' of github.com:danmar/cppcheck
2011-09-09 07:16:55 -04:00
Robert Reif
16924c7c7a
fix #3094 (Buffer access out-of-bounds in struct variable)
2011-09-09 07:16:39 -04:00
Daniel Marjamäki
84f190abf7
Fixed #3096 (false negative: memory leak not found when passing string to strtok)
2011-09-09 07:25:47 +02:00
Robert Reif
812a17f294
fix one of the TODO testcases added for #3094 (Buffer access out-of-bounds in struct variable)
2011-09-08 22:44:25 -04:00
Robert Reif
65b1a4df19
add soem test cases for #3094 (Buffer access out-of-bounds in struct variable)
2011-09-08 22:41:18 -04:00
seb777
074ad10a30
fix #195 Unusual shift operation - check this kind of code
...
return x >> ! y ? 8 : 2;
2011-09-06 22:37:19 +02:00
Robert Reif
7451c5cece
warn when buffer is not zero terminated after memmove
2011-09-05 15:59:41 -04:00
Robert Reif
f5d71d1ac5
warn when buffer is not zero terminated after memcpy
2011-09-05 15:41:37 -04:00
Robert Reif
3c8988e7a5
warn when buffer is not zero terminated after strncpy
2011-09-05 15:19:38 -04:00
Daniel Marjamäki
2601733ff7
Uninitialized vars: handle printf a little better. Ticket: #3050
2011-09-05 20:18:58 +02:00
Daniel Marjamäki
c7d0beefa8
uninitstring: fix false negatives when non-zero memset is used. Ticket: #3050
2011-09-05 19:42:48 +02:00
Robert Reif
fe85b8779e
fix #2528 (false negative: buffer access out of bounds)
2011-09-04 21:39:52 -04:00
Robert Reif
50688b28fd
fix #2889 (false negative: buffer access out of bounds on local struct member)
2011-09-04 19:54:57 -04:00
Daniel Marjamäki
8240422a09
Fixed #3078 (vector::at using int causes false positive)
2011-09-04 20:48:05 +02:00
Kimmo Varis
0c42f46717
Tests: Add tests for new --enable flags.
...
Adding tests for new --enable flafgs (performance, portability)
to CommandLineParser tests.
2011-09-04 21:45:52 +03:00
Robert Reif
c2b76cd41f
add some variable length array tests
2011-09-04 14:39:24 -04:00
Daniel Marjamäki
c34b77cebf
Fixed #3073 (False positive: Assigning an integer (int/long/etc) to a pointer is not portable)
2011-09-04 13:03:29 +02:00
Daniel Marjamäki
85d83d86ac
Fixed #3060 (False positive: Uninitialized variable: fresh)
2011-09-04 12:53:53 +02:00
Robert Reif
e782d98241
final fix for #3063 (false negative: multi dimensional arrays not well supported)
2011-09-03 21:51:00 -04:00
seb777
5c7ed46e0c
Following the discussion XX, replace the keyword C99 '_Bool' with the 'bool' keyword in the process of tokenization\nSee f29b7f9f08
2011-09-03 23:15:33 +02:00
Daniel Marjamäki
46b5d5bd00
Fixed #3069 (False positive: Memory leak: data)
2011-09-03 20:45:48 +02:00
Daniel Marjamäki
d098ed6031
Fixed #3065 (False positive: possible null pointer dereference: vi)
2011-09-03 19:43:27 +02:00
Daniel Marjamäki
c7886ca1c4
Fixed #3058 (False positive: Uninitialized variable: data)
2011-09-03 18:53:14 +02:00
Daniel Marjamäki
d23c58d387
enable: break out 'performance' and 'portability' from the 'style' id. Ticket: #3074
2011-09-03 15:30:30 +02:00
Robert Reif
d749e28dc0
another partial fix for #3063 (false negative: multi dimensional arrays not well supported)
2011-09-02 21:07:29 -04:00
Robert Reif
d85410de8c
partial fix for #3063 (false negative: multi dimensional arrays not well supported)
2011-09-02 19:35:09 -04:00
Robert Reif
f29b7f9f08
fix #3062 (false negative: Boolean variable is used in bitwise operation)
2011-09-02 17:19:06 -04:00
Robert Reif
e19cbf0cdd
fix false positive introduced by previous false negative fix commit
2011-09-02 10:39:04 -04:00
Robert Reif
833865e736
fix #3066 (False positive: Inconclusive: Assigning address of local auto-variable to a function parameter.)
2011-09-01 22:22:33 -04:00
Robert Reif
5bad978833
fix line number in messagex for CheckAutoVariables::autoVariables
2011-09-01 20:34:31 -04:00
Robert Reif
f4e07c3179
fix #3070 (Other: failed to parse a typedef string. Check continues anyway.)
2011-09-01 19:10:58 -04:00
Robert Reif
2667e34a07
fix again #3064 (false negative: returning address of stack variable)
2011-09-01 18:30:49 -04:00