Robert Reif
44a926aa4d
add a few more Microsoft TCHAR function conversions
2011-09-27 07:29:36 -04:00
Robert Reif
ec377d24eb
add support for Microsoft TCHAR character constants
2011-09-26 22:08:24 -04: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
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
Johan Samuelson
889c407f58
Fixed #3118 (Tokenizer: str*cmp() in hot spot code)
2011-09-20 19:03:19 +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
2fe182b833
set windows platform type to type executable was compiled on
2011-09-18 13:19:00 -04:00
Robert Reif
be660003ec
start adding conversions from common Windows types to standard types
2011-09-18 13:06:54 -04:00
Robert Reif
958a53eaa8
run astyle
2011-09-18 12:58:28 -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
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
2670525b4f
better fix for #3114 (infinite recursion when operator= is overloaded)
2011-09-14 19:58:11 -04:00
Robert Reif
2bc7da2c64
quick fix for #3114 (infinite recursion when operator= is overloaded)
2011-09-14 19:04:06 -04: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
735ff11469
fix #3110 (false positve: style) Boolean result is used in bitwise operation. Clarify expression with parentheses)
2011-09-12 07:32:55 -04: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
Robert Reif
e18fe56d56
refactor CheckBufferOverrun to only use multi-dimension array error messages and remove single dimension array message
2011-09-11 09:54:26 -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
Daniel Marjamäki
d93354a974
unused var: use 'else if' instead of 'if'
2011-09-11 08:18:32 +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
a9b4e21f60
refactor CheckBufferOverrun::checkScope to take an ArrayInfo parameter
2011-09-10 11:21:52 -04: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
Daniel Marjamäki
d10822ea11
fixed a few doxygen warnings
2011-09-08 18:28:05 +02:00
Daniel Marjamäki
184e0550b8
updated comments
2011-09-08 18:23:25 +02: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
cbbdd55177
fix some -Wconversion -Wsign-conversion warnings in checkbufferoverrun.cpp
2011-09-05 19:02:26 -04: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
b27bbea44a
really fix #3079 (Spelling error in unsigned variable check 'never alwayw')
2011-09-05 09:48:59 -04:00
Robert Reif
2250a2dfc3
fix #3079 (Spelling error in unsigned variable check 'never alwayw')
2011-09-05 09:04:27 -04: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
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
Robert Reif
7cb5c97e7d
move member variable lookup code from a check to the symbol database so it can be reused by other checks
2011-09-03 12:22:13 -04: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
Robert Reif
ff690abf80
better error message for #3064 (false negative: returning address of stack variable)
2011-09-01 07:10:11 -04:00
Robert Reif
e7dc765ece
fix #3064 (false negative: returning address of stack variable)
2011-08-31 21:36:31 -04:00
Daniel Marjamäki
a96028b43b
Fixed #3058 (False positive: Uninitialized variable: data)
2011-08-31 19:45:20 +02:00
Robert Reif
477d1e92c9
add new (nothrow) support to CheckUnusedVar::checkFunctionVariableUsage
2011-08-31 06:39:39 -04:00
Robert Reif
acebc635b5
add support for deallocating memory with realloc
2011-08-30 23:42:11 -04:00
Daniel Marjamäki
0529654e37
Fixed #3058 (False positive: Uninitialized variable: data)
2011-08-30 19:13:04 +02:00
Daniel Marjamäki
ef30da51bf
Fixed #3034 (Cppcheck crash on specific file (truecrypt).)
2011-08-29 19:16:52 +02:00
Robert Reif
7775934492
really fix multi-dimensional arrays with undefined size
2011-08-28 13:32:42 -04:00
Daniel Marjamäki
787bc4c384
Fixed #3016 (Preprocessor has incorrect precedence(?) for &&)
2011-08-28 18:30:58 +02:00
Robert Reif
cf6d04de74
fix #3044 (Symbol database: handle multidim array with unknown dimension 'char a[][4]')
2011-08-28 11:40:55 -04:00
Robert Reif
2d952c65e4
fix #3051 (False positive: operator= should return reference (when function takes pointer argument))
2011-08-28 11:14:15 -04:00
Robert Reif
9a0d076295
fix #3052 (False Positive - Technically the member function 'Example::Clear' can be const.)
2011-08-28 09:21:00 -04:00
Robert Reif
d643397a7e
better message for strncpy zero-terminated check
2011-08-28 09:06:51 -04:00
Daniel Marjamäki
a1aa66f370
Fixed #3039 (False Positive: Memory Leak 'p = pop(p);')
2011-08-28 11:28:14 +02:00
Robert Reif
8c093d0f8a
refactor CheckBufferOverrun::checkScope strncpy check and change experimental to inconclusive
2011-08-27 21:18:39 -04:00
Daniel Marjamäki
15e965b530
Fixed #3038 (False Positive - memory leak (struct member passed to subfunction))
2011-08-26 19:26:21 +02:00
Robert Reif
9539d22a1a
partial fix for #3050 (strncpy zero termination check behaving flaky)
2011-08-25 23:48:32 -04:00
Robert Reif
1d7ab77251
fix #3043 (False Positive - Member variable 'ProgramRecPriorityInfo::profile' is not assigned a value in 'ProgramRecPriorityInfo::operator=')
2011-08-25 23:27:10 -04:00
Robert Reif
423a1ff64e
add support for simplifying Qt emit in tokenizer
2011-08-25 20:54:35 -04:00
Robert Reif
dfe89f395a
fix #3049 (False Positive - Technically the member function 'VideoOutputNull::SetupDeinterlace' can be const.)
2011-08-25 19:13:53 -04:00
Daniel Marjamäki
6d9463139d
Fixed #3038 (False Positive - memory leak)
2011-08-25 19:59:44 +02:00
Robert Reif
6e78b51071
make all functions that call reportError names in checkbufferoverrun end in Error for consisentcy
2011-08-24 07:11:39 -04:00
Robert Reif
6f3131da8c
fix a serious symbol database bug where parts of a function could be skipped
2011-08-23 20:12:29 -04:00
Daniel Marjamäki
2f0fc9444f
Fixed #3041 (false positive reported for error with id='deallocuse')
2011-08-23 23:18:47 +02:00
Robert Reif
c7cb38b0b5
fix #3040 (False positive - Technically the member function 'PSIPTable::SetSection' can be const.)
2011-08-22 20:34:00 -04:00
Kimmo Varis
abf29fc531
Add doxygen grouping for the new file.
2011-08-22 20:46:53 +03:00
Kimmo Varis
71778095c6
Compile fix.
2011-08-22 20:21:25 +03:00
Kimmo Varis
716679ec7d
Move Suppressions class to own source files.
...
I want to use Suppressions class also in GUI. And that is easier
to do when it is not internal class of Settings class. And in
general is it more natural that Settings class only contains list
of suppressions and implementation is separate.
2011-08-22 19:57:28 +03:00
Robert Reif
8c1efe9bb6
improve message for #3035 (false negative: strcpy(dst, src) where src is bigger than dst)
2011-08-21 15:18:41 -04:00
Robert Reif
67e8731a96
partial fix for #3035 (false negative: strcpy(dst, src) where src is bigger than dst)
2011-08-21 14:44:55 -04:00
Daniel Marjamäki
7afec3cf6d
Fixed #3032 (False positive: possible null pointer dereference (assignment in condition))
2011-08-21 17:49:00 +02:00
Robert Reif
7eb43bc107
partial fix for #3030 (Improve check: Returning pointer to local array variable with '&' pointer operator)
2011-08-20 15:08:30 -04:00
Daniel Marjamäki
d5bf5b7ad2
Preprocessor: allow that 'missingInclude' messages are suppressed with '--suppress=missingInclude'
2011-08-20 11:23:59 +02:00
Daniel Marjamäki
939504af3c
Cppcheck: allow that 'toomanyconfigs' are suppressed. show these messages by default even though 'information' hasn't been enabled.
2011-08-20 11:20:25 +02:00
Daniel Marjamäki
27b29e5b8e
Fixed #3023 (False positive: no possible null pointer dereference here: 'WARN_ON(!abc || abc->x == 0);')
2011-08-20 09:47:55 +02:00
Daniel Marjamäki
dd09b24208
Fixed #3024 (False positive: memory leak for 'rc.bitmap' when rc is added to linux kernel list)
2011-08-20 09:17:34 +02:00
Daniel Marjamäki
fe78e28d70
Cppcheck: Don't show information messages about interrupted checking unless --enable=information has been given.
2011-08-19 22:32:57 +02:00
Kimmo Varis
80ba3d6a92
Merge pull request #32 from rpavlik/qmake-configure-rules
...
Qmake configure rules
2011-08-19 13:00:34 -07:00
Robert Reif
2dd93dff75
move unused variable checks from checkother to checkunusedvar
2011-08-19 14:35:25 -04:00
Robert Reif
9fbef3ca7b
fix #3011 (new check: when first comparison is true, the 2nd comparison is always true)
2011-08-19 13:28:37 -04:00
Daniel Marjamäki
a735790e77
using boolean result in bitwise operation. fix false positive for '.. != (char *) &x'
2011-08-19 18:55:20 +02:00
Daniel Marjamäki
2dd1e290eb
fixed false positives for the 'bitwise operator / comparison operator' check
2011-08-19 18:06:28 +02:00
Robert Reif
eda9ff6fc5
refactor checkother to move error messages to follow check and rename some error functions to end in Error
2011-08-19 11:53:43 -04:00
Daniel Marjamäki
314d5f1e79
fixed false positive for 'using bitwise operation on boolean result'
2011-08-19 17:07:26 +02:00
Daniel Marjamäki
72b01d1ca0
Improve check: Tweaked the assignAndCompare to handle | also in addition to &
2011-08-19 16:10:09 +02:00
Daniel Marjamäki
c107fdd2d4
Fixed #3018 (false positive: (style) Suspicious condition (assignment+comparison), it can be clarified with parentheses)
2011-08-19 13:54:06 +02:00
Daniel Marjamäki
40b493e621
Improve check: Clarify condition (using boolean result in bitwise operation)
2011-08-19 13:40:54 +02:00
Daniel Marjamäki
0d7c80ef21
improved comment of previous commit
2011-08-19 07:28:15 +02:00
Daniel Marjamäki
4606251ce8
Fixed #3001 (False Positive: Redundant assignment to itself)
2011-08-19 07:23:11 +02:00
Daniel Marjamäki
e5ff920ea9
Suspicious condition: Better handling when rhs is non-numeric
2011-08-19 00:56:15 +02:00
Daniel Marjamäki
a7728fef48
New check: warn about such suspicious conditions: '(a & b == c)'
2011-08-19 00:15:20 +02:00
Ryan Pavlik
50b0e95314
put the rules logic in its own .pri file, and allow easier override
2011-08-18 15:42:19 -05:00
Ryan Pavlik
33b5970c91
use the qmake config setting HAVE_RULES to enable/disable pcre rules support,
...
defaulting to on except on Windows.
2011-08-18 12:13:21 -05:00
Daniel Marjamäki
afed93d7d6
Command line: Added --std option. Right now only --std=posix is possible but other options might be added later.
2011-08-17 20:08:55 +02:00
Robert Reif
88019658b4
fix #3013 (segmentation fault of cppcheck ( struct x : virtual y ))
2011-08-16 19:16:58 -04:00
Reijo Tomperi
dd666b7c1b
Add command line option: --debug-fp ... If used, cppcheck will print out the code generating error into output stream.
...
This is ment to be used for debugging false positive errors in Cppcheck.
Current implementation tries two alternatives. Without all headers or with all headers and prints out the option with
less code. In future versions this could try with individual headers or group of header files.
2011-08-16 22:58:27 +03:00
Daniel Marjamäki
5f25f2c6e6
Fixed #3012 (False Pos Memory Leak with a Macro)
2011-08-16 20:39:17 +02:00
Daniel Marjamäki
4f962acf16
Fixed #3009 (Using numeric constants in kernel space code)
2011-08-16 20:16:33 +02:00
Robert Reif
a6c5eff1be
fix #3006 (segmentation fault of cppcheck ( x < () < ))
2011-08-15 07:19:49 -04:00
Robert Reif
4168d79b09
fix #3005 (segmentation fault of cppcheck ( enum : x ))
2011-08-15 07:07:12 -04:00
Robert Reif
5364b4f7fb
fix #3007 (false positive: (style) Struct 'Fred' hides typedef with same name)
2011-08-15 06:56:15 -04:00
Robert Reif
ed507b73ee
fix #3004 (false positive: (style) Struct 'Fred' hides typedef with same name)
2011-08-14 21:00:05 -04:00
Robert Reif
08e9d64a86
fix #3003 (segmentation fault of cppcheck (typedef a x[]; y = x ))
2011-08-14 20:38:16 -04:00
Robert Reif
b7f42535ec
fix #3000 (false positive: (style) Struct 'Fred' hides typedef with same name)
2011-08-14 18:50:33 -04:00
Robert Reif
389ab80b63
fix #2999 (false positive: (style) Struct 'Fred' hides typedef with same name)
2011-08-14 18:06:05 -04:00
Daniel Marjamäki
961b6e7752
Preprocessor: Added safety checks in case the code is corrupt. Related to ticket #2998
2011-08-14 18:35:34 +02:00
Robert Reif
da9bf37918
refactor CheckNullPointer::nullPointerByDeRefAndChec() to pull variable type lookup out of loop
2011-08-14 10:53:09 -04:00