amai2012
0ddd7752b5
Avoid crash reported in #5943 (using the example from duplicate ticket #5971 )
...
Replace a few size_t/unsigned int by std::size_t
2014-07-06 14:48:24 +02:00
Daniel Marjamäki
a4a6f3e1be
Tokenizer: Removed Tokenizer::simplifyConditionOperator(). Using the AST and ValueFlow, it should be much easier to parse ?: than before.
2014-06-10 19:30:13 +02:00
Daniel Marjamäki
8cc1f664d8
Uninitialized member variable: Fixed false negative when struct is read
2014-05-10 20:20:55 +02:00
Daniel Marjamäki
4c344adcf1
Uninitialized struct member: fixed false negative when struct assignment is seen
2014-05-10 19:56:44 +02:00
Daniel Marjamäki
04cd261ee2
Fixed #5664 (false positive: (error) Uninitialized variable: j (Comma operator in for loop))
2014-04-21 10:32:29 +02:00
Daniel Marjamäki
c8ae1e4751
Fixed #5658 (false positive: (error) Uninitialized variable: s)
2014-04-10 15:59:37 +02:00
Daniel Marjamäki
9b1d058410
Fixed #5660 (false positive: (error) Uninitialized variable: result)
2014-04-10 06:40:53 +02:00
Daniel Marjamäki
71fda0ea0c
Fixed GCC warning about shadowed variable settings
2014-04-04 07:02:36 +02:00
PKEuS
7e4081f7f5
Treat syntaxError and cppcheckError as InternalErrors (throw as exception, #4268 )
2014-03-27 13:15:21 +01:00
PKEuS
9b4b90f6a0
Avoid loading libraries multiple times in test suite
...
-> Massive speedup for test suite (especially on slow systems)
2014-03-24 09:59:05 +01:00
PKEuS
5f2067e401
Refactorized dead code elimination:
...
- Use library to get noreturn functions
- Fixed do-while simplification (#4940 )
2014-03-23 10:59:41 +01:00
orbitcowboy
6507824a34
Added support for putchar() to std.cfg.
2014-03-20 05:49:38 +01:00
orbitcowboy
80e3b49cfc
Added support for ftell() and puts() to std.cfg.
2014-03-20 04:10:41 +01:00
orbitcowboy
30006cf06f
Added support for fputs() to std.cfg.
2014-03-20 02:13:41 +01:00
orbitcowboy
b37e9601c1
Added support for fgetc() to std.cfg.
2014-03-20 00:59:52 +01:00
Daniel Marjamäki
8de4246713
Uninitialized variables: Improved handling of function calls when struct members are checked
2014-03-20 06:48:17 +01:00
Martin Ettl
fe1b46c174
Extended std.cfg
2014-03-19 21:08:48 +01:00
Alexander Mai
29d401ff38
Fixed #3098 (false negative: unitialized variable being passed to strcoll())
2014-03-06 16:31:31 +01:00
Daniel Marjamäki
fd3a8a2a18
Update copyright
2014-02-15 07:45:39 +01:00
Daniel Marjamäki
0c47555423
CheckNullPointer: use library instead of hard coded info
2014-01-26 16:19:49 +01:00
Daniel Marjamäki
bc9ad08831
Fixed #5245 (false positive: Uninitialized variable (assignment inside ternary operator))
2014-01-25 10:12:50 +01:00
Daniel Marjamäki
30cae358d8
Removed the --value-flow flag. ValueFlow analysis will always be enabled from now on.
2014-01-17 18:07:05 +01:00
Daniel Marjamäki
e45a2e2c61
Fixed #5347 (False positive: uninitialized variable (try catch))
2014-01-14 06:24:09 +01:00
PKEuS
4f0121ee2f
Splitted simplification out of tokenize()
2013-12-30 17:45:28 +01:00
Daniel Marjamäki
6182394966
Uninitialized variables: Fixed false positive taking value of pointer that is allocated but not initialized
2013-12-25 14:00:27 +01:00
Daniel Marjamäki
26dfddac6b
UninitVar: Fixed false positive when checking if allocated pointer is null
2013-12-24 12:48:17 +01:00
Daniel Marjamäki
753559fff3
Uninitialized variables: Don't warn about try/catch exception variables
2013-12-24 07:39:15 +01:00
Daniel Marjamäki
661784a170
Fixed #5255 (False positive (error) Uninitialized variable: ptr2 - calling a static member function)
2013-12-23 16:50:27 +01:00
Daniel Marjamäki
e2fa6a291c
Uninitialized variables: Fixed false negatives for loop variables / pointer dereference
2013-12-23 12:27:00 +01:00
Daniel Marjamäki
80dec5a976
Uninitialized variables: Fixed FP when taking address of uninitialized variable
2013-12-13 20:10:22 +01:00
Daniel Marjamäki
7fe923bfc5
Uninitialized variables: Fixed FP when the variable is initialized in do-while condition
2013-12-13 13:27:01 +01:00
Daniel Marjamäki
3e6fbc6517
Fixed uninitialized variable FP after realloc if it fails. Related with ticket: #5240
2013-12-13 07:15:59 +01:00
Daniel Marjamäki
35189e80f2
Uninitialized variables: Fixed false positive for '*p=..'
2013-12-12 15:33:31 +01:00
Daniel Marjamäki
1b86615a69
Uninitialized variables: Fixed false positive for 'p=malloc; if (p) {}'
2013-12-12 11:44:07 +01:00
Daniel Marjamäki
4e7594748d
Uninitialized variables: Fixed false positive for 'p=malloc; if (python tools/daca2.py b)'
2013-12-12 09:17:41 +01:00
Daniel Marjamäki
9f62740e1d
Fixed #5236 (varid 0: vlc: src/misc/objects.c:126)
2013-12-12 08:44:00 +01:00
Daniel Marjamäki
a4f9cb78d5
Uninitialized variables: Fixed false positives when passing allocated pointer to function
2013-12-11 05:54:42 +01:00
Daniel Marjamäki
ef15e40de5
Uninitialized variables: error when passing uninit pointer to function
2013-12-10 18:36:16 +01:00
Daniel Marjamäki
be5c00d215
Uninitialized variables: check function arguments
2013-12-09 15:58:42 +01:00
Daniel Marjamäki
14a00046a3
Fixed #5207 (Struct uninitialized members useage is not giving error (malloc).)
2013-12-04 20:32:20 +01:00
Daniel Marjamäki
d8b25da73c
Fixed #4740 (False Positive: Uninitialised variable 'int *a[2][19]; int **b = a[0];')
2013-11-25 06:38:23 +01:00
Daniel Marjamäki
7fc07989a7
UninitVar: Fixed false positive 'data is allocated but not initialized' when there is assignment
2013-11-23 10:24:29 +01:00
Daniel Marjamäki
71e61fb1ed
Uninitialized variables: Fixed false positive when using ?:
2013-11-17 12:42:53 +01:00
Daniel Marjamäki
77e09d72a1
Uninitialized variables: Fixed false negatives when using ({})
2013-11-17 12:11:18 +01:00
Daniel Marjamäki
d342387b95
Uninitialized var: Fixed false negatives for self assignment
2013-11-16 18:07:33 +01:00
Daniel Marjamäki
cfd6b0c384
UninitVar: fixed false negatives for function calls
2013-11-16 12:02:21 +01:00
Simon Martin
185b88c6e3
Ticket #5073 : Don't crash upon invalid do-while loop.
2013-11-08 23:13:21 +01:00
Daniel Marjamäki
7996d609be
Fixed #5108 (false positive: uninitialized variable (assignment in function parameter))
2013-11-04 23:09:15 +01:00
Daniel Marjamäki
51ad9ab6ac
Fixed #4896 (FP Uninitialized variable on template function)
2013-10-26 18:39:40 +02:00
Felipe Pena
c37ba4cbcf
- Fixed false positive when using typeof/__alignof__
2013-10-12 13:46:14 -03:00
Daniel Marjamäki
e3b7bce72b
Fixed #4907 (False positive 'uninitStructMember' on structs with unions)
2013-09-30 06:35:31 +02:00
Daniel Marjamäki
698e9e2b59
reverted ee14ea4f
. I think this fix was too generic. If there is a union in the struct then only the union members should be skipped.
2013-09-23 17:52:42 +02:00
Daniel Marjamäki
ee14ea4fc2
Fixed #4907 (False positive "uninitStructMember" on structs with unions)
2013-09-23 07:20:20 +02:00
Daniel Marjamäki
64454068ec
Fixed #4934 (false positive: Uninitialized variable (loop with inner condition '(x=1)'))
2013-09-23 06:07:01 +02:00
Lucas Manuel Rodriguez
acd65a6829
Fixed #4991 : False Positive - Dangerous usage of 'arr' (not null-terminated)
2013-08-29 08:12:05 -03:00
PKEuS
a9a5dc0354
Updated to AStyle 2.03, require this version
2013-08-07 16:27:37 +02:00
Daniel Marjamäki
2a1af1acda
CheckUninitVar: Assertion for '} while (' after 'do {..' in debug builds. Bail out in release builds to avoid segfaults.
2013-07-28 12:41:38 +02:00
Daniel Marjamäki
8f332af849
Uninitialized variables: Avoid FP when using '?:'
2013-07-10 16:44:35 +02:00
Daniel Marjamäki
2ef0a40aec
Fixed #4893 (FP Uninitialized variable on sizeof of itself)
2013-07-06 08:52:47 +02:00
Daniel Marjamäki
ba23b65179
Fixed #4885 (FP Uninitialized variable when using comma)
2013-06-29 09:33:51 +02:00
Daniel Marjamäki
6997d38881
Uninitialized variables: fixed false positive in while loop
2013-06-27 18:28:00 +02:00
Daniel Marjamäki
6b01d2d5a8
Fixed #4747 (Can not find uninitialized variable (variable used in rhs in assignment))
2013-06-27 16:53:15 +02:00
Daniel Marjamäki
2265c61734
Fixed #4879 (false positive: uninitialized variable in inner for inside while (regression))
2013-06-26 17:02:57 +02:00
Daniel Marjamäki
cfd960d794
Fixed #3765 (false negative: unitialized variable)
2013-06-25 18:40:41 +02:00
Daniel Marjamäki
ae36472a1b
Fixed #4778 (FP: Uninitialized variable: av)
2013-06-14 07:21:53 +02:00
Daniel Marjamäki
2d955bb9a6
Uninitvar: Added TODO test case for false negatives. Related with #4652
2013-06-02 18:26:03 +02:00
Daniel Marjamäki
065853a59a
Fixed #4652 (False positive: variable value tracking into loop body)
2013-05-29 16:16:12 +02:00
Frank Zingsheim
bca751b9f4
Fixed #4773 (Regression: wrong detection of unitialized variable)
2013-05-06 18:45:00 +02:00
Daniel Marjamäki
bfb1bc50e3
Fixed #4760 (false negative: (error) usage of uninitialized variable (struct member))
2013-05-02 20:34:15 +02:00
Daniel Marjamäki
44cb070e13
Fixed #4737 (False positive: Uninitialized variable 'do_something(&((char*)&var)[0],1);')
2013-05-01 13:52:28 +02:00
Daniel Marjamäki
80cb2a9b20
Updated TestUninitVar test cases. They should not have unsimplified code.
2013-04-17 21:06:19 +02:00
Daniel Marjamäki
7fdaba43ed
Uninitialized variables: Fixed fp when initializing struct with function in loop body
2013-04-10 20:46:44 +02:00
Daniel Marjamäki
96a5429cee
Uninitialized variables: Assume that function initializes struct if it is unknown if it does
2013-04-10 20:04:32 +02:00
Daniel Marjamäki
4c8b17c040
Fixed #4717 (False positive: Uninitialized variable inside ({..}))
2013-04-09 17:02:11 +02:00
Daniel Marjamäki
894a2435ae
Fixed #4718 (False positive: unititialized variable (value flow))
2013-04-08 19:34:39 +02:00
Daniel Marjamäki
c9469993e2
Uninitialized variables: Fixed false positives when using sizeof inside loop
2013-03-22 08:10:46 +01:00
Daniel Marjamäki
a79354d51c
Uninitialized variables: Fixed false positive when taking address of uninitialized array that is a struct member
2013-03-20 16:59:45 +01:00
Ettl Martin
1b9c1c03fa
unittests: removed not needed '\n' at the end of testcases.
2013-03-20 15:36:16 +01:00
Daniel Marjamäki
1f04e2c228
Fixed #4439 (False positive: Uninitialized variable (casting address))
2013-03-13 17:32:47 +01:00
Daniel Marjamki
ee435bf885
Fixed #4600 (False positive Uninitialized struct member when using it as 'out parameter')
2013-02-23 15:57:58 +01:00
Daniel Marjamäki
382d7a10e8
Uninitialized variables: improved checking of c++ code
2013-02-15 18:13:47 +01:00
Daniel Marjamäki
28e38a9e56
Fixed #4519 (false positive: (error) Uninitialized variable: eax (inline assembly usage))
2013-02-12 15:59:23 +01:00
Daniel Marjamäki
75cf951c56
add return value to test case
2013-02-11 18:39:03 +01:00
Daniel Marjamäki
442db6cdf9
Fixed #4569 (False Positive: Uninitialised variable)
2013-02-11 18:31:14 +01:00
Daniel Marjamäki
94f1d34dcb
Fixed #4560 (false positive: (error) Uninitialized variable: s)
2013-02-11 17:05:59 +01:00
Mathias De Maré
dfd557888d
Fixed #4565 (false positive: dangerous usage (not null-terminated))
2013-02-10 13:36:40 +01:00
Frank Zingsheim
5144307642
Raise syntax error for if-condition without parentheses according to #2518 #4171
2013-02-05 21:13:57 +01:00
Daniel Marjamäki
4ac5648656
Uninitialized struct: Fixed false positive in for loop
2013-02-05 17:01:46 +01:00
Frank Zingsheim
89560564ed
Refactoring: Add braces to an if-block, for-block, etc. in tokenizer.
...
Fixed #4521 (Tokenizer: Wrong braces for triple if else)
2013-02-02 16:01:34 +01:00
Daniel Marjamäki
3679a809dd
Uninitialized variables: fixed false positive
2013-01-28 18:08:20 +01:00
Daniel Marjamki
8738223e82
Fixed #4512 (Improve check: Uninitialized variable not detected)
2013-01-26 08:16:53 +01:00
Daniel Marjamäki
ae43b12bf1
Fixed #4511 (False positive: uninitialized struct member)
2013-01-25 18:20:57 +01:00
Robert Reif
3b08b410a2
Symbol database: Improved function lookup (a.b.f()). Ticket: #4494
2013-01-25 06:49:04 +01:00
Daniel Marjamäki
c235737b6c
Uninitialized variables: improved checking of loops
2013-01-24 19:41:15 +01:00
Robert Reif
cecd726b11
Symbol database: Improved function lookup for foo.f(). Ticket #4494
2013-01-23 16:53:55 +01:00
Robert Reif
ddb604d1a5
Symbol database: function lookup when :: is used. Ticket #4494
2013-01-22 06:55:25 +01:00
Daniel Marjamki
c478a3214f
Uninitialized variables: Added TODO test case (while)
2013-01-20 18:40:24 +01:00
Daniel Marjamki
76534ccd1b
Uninitialized struct member: Fixed false negatives for return statements
2013-01-20 17:54:32 +01:00
Daniel Marjamki
e63f2c3b5b
Uninitialized struct member: Avoid false positive when struct member is passed by address
2013-01-20 13:12:40 +01:00
Daniel Marjamki
f1c195e652
Fixed #3506 (false negative: not initialized variables ( struct timeval))
2013-01-19 12:48:56 +01:00
Daniel Marjamki
3cf0e88fbe
Uninitialized struct members: Improved checking when struct member is used in expression
2013-01-19 10:09:58 +01:00
Daniel Marjamäki
7c615f0f12
Fixed #4497 (False positive: uninitialized struct (writing/reading member))
2013-01-18 21:26:28 +01:00
Daniel Marjamäki
77e9f65e6b
Uninitialized struct members: Fixed unit test
2013-01-17 23:55:13 +01:00
Daniel Marjamäki
2c6b383822
Uninitialized member variables: Improvements
2013-01-17 21:04:22 +01:00
Daniel Marjamäki
93fb6b0c6a
Fixed #4493 (FP: uninit struct member (struct is assigned))
2013-01-17 17:01:04 +01:00
Daniel Marjamäki
5773e69ab1
Uninitialized variables: Add experimental checking of struct members
2013-01-16 20:28:29 +01:00
Reijo Tomperi
5d5f7085bf
Updating year 2012 -> 2013 to .cpp and .h files and man page.
2013-01-01 18:29:08 +02:00
Daniel Marjamäki
de2c133f6a
Fixed #4426 (False positive: Unitialized variable warning when comparing addresses)
2012-12-28 12:32:15 +01:00
Daniel Marjamäki
b914466285
Uninitialized variables: fixed false positives by bailing out when variable is conditionally initialized and then there is a conditional return.
2012-12-27 18:45:00 +01:00
Daniel Marjamäki
f16c30248a
Uninitialized variables: fixed FP when there are function calls where type* is converted to unknown_type
2012-12-25 14:05:29 +01:00
Daniel Marjamäki
f381058293
Uninitialized variables: fixed FP when there are suspicious function calls where type** is converted to type*
2012-12-25 13:58:15 +01:00
Daniel Marjamäki
bcc5a82b1d
Uninitialized variables: Fixed FP when using typeof on uninitialized data in return statement
2012-12-25 13:31:54 +01:00
Daniel Marjamäki
299c1bb208
Uninitialized variables: handle unsimplified labels better
2012-12-25 10:37:21 +01:00
Daniel Marjamäki
83da4125e3
Uninitialized variables: Better value flow analysis. Fixed false positives.
2012-12-24 19:11:13 +01:00
Daniel Marjamäki
0b4da3d5cd
Uninitialized variables: Fixed false positives when variable x is given a nonzero value when variable y is uninitialized.
2012-12-23 16:27:04 +01:00
Daniel Marjamäki
2050cd71db
Uninitialized variables: Better testing of function handling
2012-12-21 19:32:56 +01:00
Daniel Marjamäki
dc6aa92f3b
Uninitialized variables: warn about structs in C code
2012-12-21 18:50:38 +01:00
Daniel Marjamäki
cf84c211ed
Uninitialized variables: Improved handling of function calls
2012-12-21 17:04:15 +01:00
Daniel Marjamäki
415ee977d8
Uninitialized variables : fixed false positives when passing address of pointer to function.
2012-12-21 16:57:49 +01:00
Daniel Marjamäki
ccdea4dc2b
Uninitialized variables: Improved checking of functions
2012-12-20 19:45:30 +01:00
Daniel Marjamäki
3913fd8398
Fixed #4320 (False positives 'unassignedVariable' and 'uninitvar')
2012-12-18 19:02:30 +01:00
PKEuS
4737966caf
Unit test cleanup: Removed some empty lines and whitespaces before \n.
2012-12-06 10:19:22 -08:00
Daniel Marjamäki
82223227bd
Uninitialized variables: Fixed false negative in new checking when using while loops
2012-11-30 06:30:04 +01:00
Daniel Marjamäki
68327b3c64
Uninitialized variables: Fixed TODO testcase
2012-11-29 18:41:48 +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
24b98feadb
Message refactorization: checkuninitvar.cpp, checkunusedfunctions.cpp, checkunusedvar.cpp
2012-11-01 18:40:20 +01:00
Daniel Marjamäki
753942df0c
Revert "Fixed #4165 (False positive:(error) Uninitialized variable: here)"
...
This reverts commit 96b1890797
.
2012-09-26 16:15:35 +02:00
Daniel Marjamäki
96b1890797
Fixed #4165 (False positive:(error) Uninitialized variable: here)
2012-09-25 20:45:42 +02:00
XhmikosR
3c14e4b52a
test: tabs to spaces, remove trailing spaces and extra empty lines at the end of files
2012-09-17 13:51:40 +02:00
Daniel Marjamäki
84c0368bfd
Fixed #3586 (false positive: uninitvar in argument in namespaced function)
2012-09-15 10:48:17 +02:00
Ettl Martin
f1faaac1f2
Added testcases for #3098
2012-09-09 19:49:40 +02:00
Daniel Marjamäki
d3bdd84d8b
Fixed #4175 (segmentation fault of cppcheck)
2012-09-09 18:56:26 +02:00
Daniel Marjamäki
3032ded9aa
replaced tabs with spaces
2012-09-05 19:46:44 +02:00
Daniel Marjamäki
0d82b08080
Fixed #4040 (false positive: (error) Uninitialized variable: iter)
2012-08-27 15:48:21 +02:00
Daniel Marjamäki
d34924ba6d
Uninitialized variables: Fixed false positive when there is assignment in condition
2012-07-17 07:03:40 +02:00
Daniel Marjamäki
f9da83f4b5
Fixed #3926 (false postive: (error) Uninitialized variable: exitpattern)
2012-07-03 18:52:23 +02:00
Daniel Marjamäki
2e3a08a8c1
Fixed #3916 (false positive: uninitialized variable when using assignment and , in rhs)
2012-06-27 20:44:19 +02:00
Daniel Marjamäki
9da3373876
Fixed #3919 (False positive: uninitialized variable (extern))
2012-06-26 18:28:41 +02:00
Ettl Martin
8c39b95aae
#3873 added testcase to make sure false positive does not appear again.
2012-06-24 00:00:15 +02:00
Daniel Marjamäki
f59078fad9
Refactoring TestUninitVar. Added TODO test case.
2012-06-23 16:44:02 +02:00
Daniel Marjamäki
1e1b20d113
Refactoring TestUninitVar. Created TestUninitVar::uninitvar_return
2012-06-23 16:27:57 +02:00
Daniel Marjamäki
b6f4dbd067
Uninitialized variables: Fixed TODO assertion (related with ticket #3106 )
2012-06-23 16:06:20 +02:00
Daniel Marjamäki
d3ce3e78bd
Uninitialized variables: Added test case
2012-06-23 15:52:35 +02:00
Daniel Marjamäki
7f5950967e
Reviewed handling of >> in return statements in C files in UninitVar checking
2012-06-23 15:47:48 +02:00
Daniel Marjamäki
f0f69ed818
Reviewed handling of << and >> in C files in CheckUninitVar
2012-06-23 12:41:00 +02:00
Daniel Marjamäki
e2964c0c9e
Uninitialized variables: Fixed false negative when ? operator is used in rhs
2012-06-23 12:19:03 +02:00
Daniel Marjamäki
d2dbaca24b
Reviewed handling of unknown types in C files in UninitVar
2012-06-22 19:57:07 +02:00
Daniel Marjamäki
abaa044e03
Reviewed handling of unknown types in CheckUninitVar
2012-06-22 16:39:39 +02:00
Daniel Marjamäki
354406441a
Fixed #3906 (false positive uninitvar for vector pointer)
2012-06-22 16:26:43 +02:00
Daniel Marjamäki
ce5c38f52c
Fixed #3890 (False positive Uninitialized variable on returning default value on a class member)
2012-06-19 20:04:10 +02:00
Daniel Marjamäki
cc5e06b5d2
Fixed #3861 (uninitialized variables)
2012-06-13 19:09:51 +02:00
Daniel Marjamäki
c5da030674
Fixed #3869 (References to items in array result it 'Uninitialized variable' errors)
2012-06-08 16:17:55 +02:00
Ettl Martin
e584544915
added testcase for ticket #3844
2012-05-28 12:56:24 +02:00
PKEuS
f4bf94ca4f
Fixed #3845
2012-05-25 07:28:32 -07:00
PKEuS
e8cd119ebd
Improved parsing of functions that accept nullpointers but no uninitialized data ( Fixed #3811 )
2012-05-16 00:56:39 -07:00
Daniel Marjamäki
fc7f78244e
Fixed #3708 (False positive: uninitialized variable (allocation, unknown nonpointer type))
2012-05-14 18:34:39 +02:00
Ettl Martin
28510bdd38
added todo testcase for ticket 3597
2012-05-01 14:26:34 +02:00
Ettl Martin
2848c61e88
#3344 added missing testcase
2012-04-26 13:37:13 +02:00
Daniel Marjamäki
fb6c7f33f0
Fixed #3707 (Uninitialized variable with operator >> and templates)
2012-04-24 19:50:54 +02:00
Daniel Marjamäki
2757229064
Fixed #3666 (False positive: Uninitialized variable (taking address))
2012-03-16 17:28:05 +01:00
Daniel Marjamäki
a118f82ca7
Tokenizer::simplifyVarDecl: Don't simplify inside parenhteses
2012-02-18 15:05:29 +01:00
Daniel Marjamäki
47c7e346aa
Uninitialized variables: Another fix for false positives when it's known that inner conditions are true
2012-02-06 19:26:28 +01:00
Daniel Marjamäki
05fc77c347
Revert "Uninit var: Added TODO test case"
...
The test case was not valid because the variable assignment is redundant and is therefore removed by the tokenizer.
This reverts commit 548a43fc49
.
2012-02-06 07:41:48 +01:00
Daniel Marjamäki
d6a887e1f9
Uninitialized variables: Fixed false positives when goto is simplified and inner condition is known to be true/false
2012-02-06 07:32:29 +01:00
Daniel Marjamäki
548a43fc49
Uninit var: Added TODO test case
2012-02-06 07:17:39 +01:00
Daniel Marjamäki
b8faee9d30
Fixed #3497 (False positive: Uninitialized variable)
2012-01-21 20:42:41 +01:00
Edoardo Prezioso
37f3aa1528
Fixed ticket #3486 (segmentation fault of cppcheck)
2012-01-13 23:53:53 +01:00
Daniel Marjamäki
47716ee4ca
Fixed #3497 (False positive: Uninitialized variable)
2012-01-13 07:26:56 +01:00
Edoardo Prezioso
a951d34aa8
Fixed ticket #3480 (segmentation fault of cppcheck)
2012-01-09 12:48:52 +01:00
Daniel Marjamäki
01759b03f9
Fixed #3463 (Uninitialized variable variable pointer)
2012-01-02 11:25:13 +01:00
Reijo Tomperi
8cae17fda8
Update year to 2012
2012-01-01 01:05:37 +02:00
Daniel Marjamäki
32ed84f4c5
Uninitialized variables: Fixed false positives when using typeof()
2011-12-27 17:03:48 +01:00
Daniel Marjamäki
7c606c4e3b
Uninitialized variables: Fixed false positives for such code: 'if (cond1) { a=0; } if (cond1) { if (cond2) { use_a; } }'
2011-12-27 13:16:16 +01:00
Daniel Marjamäki
f6b201bb3b
Uninitialized variables: Fixed false positives when pointer is dereferenced in unexpanded macro
2011-12-27 10:18:49 +01:00
Daniel Marjamäki
fdb6ee2ad7
Uninitialized variables: Fix false positives related to for loop
2011-12-27 08:18:05 +01:00
Daniel Marjamäki
5bac8eca37
Uninitialized variables: Fixed false positives (caused by my 'check more variables' commit)
2011-12-26 22:14:52 +01:00
Daniel Marjamäki
5aaec7adc5
Uninitialized variables: Better handling of variable usage in condition
2011-12-26 18:56:40 +01:00
Daniel Marjamäki
59cd099ba7
Uninitialized variables: Fixed false positives caused by recent commit when potentially uninitialized variable is read in condition
2011-12-26 18:32:42 +01:00
Daniel Marjamäki
481fa532a8
Uninitialized variables: Fixed false positives caused by recent improvement when variable is potentially initialized in else block.
2011-12-26 18:17:13 +01:00
Daniel Marjamäki
c56e2e7cf9
Uninitialized variables: Fixed false positives for unconditional inner scopes
2011-12-26 17:52:32 +01:00
Daniel Marjamäki
025518c474
Uninitialized variables: Fixed false positives when goto is used.
2011-12-26 16:46:10 +01:00
Daniel Marjamäki
8eb067358c
Uninitialized variables: check more variables
2011-12-26 14:01:46 +01:00
Daniel Marjamäki
f48edb63a3
Uninitialized variables: Improved checking when there are multiple if/else and a certain path causes an error
2011-12-26 12:36:35 +01:00
Daniel Marjamäki
ba5558748d
Uninitialized variables: Fixed false 'dangerous usage of strncpy' positive when resulting string is used by strncpy
2011-12-23 08:44:28 +01:00
Daniel Marjamäki
f09a5b408b
Uninitialized variables: Fixed false positives when sizeof is used in condition. Ticket: #3369
2011-12-17 16:08:55 +01:00
Daniel Marjamäki
fe8393aafc
Uninitialized variables: Fixed false positives in sizeof. Ticket: #3369
2011-12-17 09:51:45 +01:00
Daniel Marjamäki
dfedb920f8
Uninitialized variables: Fixed false positive when address of variable is taken inside = { .. }. Ticket: #3369
2011-12-17 07:56:46 +01:00
Daniel Marjamäki
0572321572
Fixed #3423 (Uninitialized variable in operator>>)
2011-12-16 20:34:44 +01:00
Daniel Marjamäki
5f1fadec7b
Uninitialized variables: Fixed false positives when many 'if' are used. Ticket: #3369
2011-12-16 19:56:32 +01:00
Daniel Marjamäki
3153650be3
Uninitialized variable: added TODO test case. Ticket: #3369
2011-12-15 20:55:37 +01:00
Daniel Marjamäki
d2d7e25f3f
Uninitialized variables: Fixed false positive in for condition. Ticket: #3369
2011-12-15 20:48:26 +01:00
Daniel Marjamäki
40f2f4f7f6
Uninitialized variables: Fixed false positives when there are assembler code. Ticket: #3369
2011-12-15 20:29:57 +01:00
Daniel Marjamäki
167530bf60
Uninitialized variable: Fixed test failure. Ticket: #3369
2011-12-15 20:15:37 +01:00
Daniel Marjamäki
6221145be8
Fixed #3414 (false positive: (error) Uninitialized variable: SOutput)
2011-12-15 18:30:59 +01:00
Daniel Marjamäki
005b1cff61
Fixed #3417 (False positive: Uninitialized variable when conditionally set)
2011-12-15 18:15:58 +01:00
Daniel Marjamäki
3a432fa959
Uninitialized variables: better handling of initialization with >>. Ticket: #3369
2011-12-15 16:55:55 +01:00
Daniel Marjamäki
b3c35d4b32
Fixed #3415 (Segmentation fault in new check for uninitialized variables)
2011-12-15 16:49:14 +01:00
Daniel Marjamäki
295f486cde
Uninitialized variables: Detect more errors when variable is given as array index. Ticket: #3369
2011-12-14 19:56:58 +01:00
Daniel Marjamäki
63e2f64b9c
Uninitialized variables: Fixed false positives for loops. Ticket: #3369
2011-12-14 18:54:03 +01:00
Daniel Marjamäki
8e3e634ce0
Uninitialized variables: Detect more errors. Ticket: #3369
2011-12-14 18:28:30 +01:00
Daniel Marjamäki
419ae2a135
Uninitialized variables: Fixed false positive in new checking when variable is initialized in condition
2011-12-14 17:17:24 +01:00
Daniel Marjamäki
ba463295c2
Uninitialized variables: improved check to detect more errors. Ticket: #3369
2011-12-14 06:00:17 +01:00
Daniel Marjamäki
c7ce87d060
Uninitialized variables: Fixed false positives for break/continue/throw
2011-12-14 05:45:52 +01:00
Daniel Marjamäki
458fa0874a
Uninitialized variables: Started writing a new check. Ticket: #3369
2011-12-13 21:57:27 +01:00
Daniel Marjamäki
414e0ecc3c
Uninitvar: Reactivated the checking
2011-11-30 18:57:52 +01:00
Daniel Marjamäki
b92959809c
Uninitvar: Made checking experimental
2011-11-20 15:19:56 +01:00
Benjamin Goose
54c445ca20
Add tests for various bugs.
...
False positive: uninitialized variable (ticket #3287 ).
False positive: null pointer dereference in typeid (ticket #3290 ).
2011-11-04 12:27:32 +01:00
Daniel Marjamäki
f7fe665b00
Fixed #3231 (False positive: uninitialized variable '({...})')
2011-10-30 18:19:09 +01:00
Daniel Marjamaki
71f08d0a66
Fixed #3222 (false positive: Uninitialized variable with function pointer)
2011-10-30 17:22:30 +01:00
Daniel Marjamäki
316aa920eb
Fixed #3245 (False positive: Dangerous usage of 'string' (strncpy doesn't always 0-terminate it))
2011-10-29 19:11:42 +02:00
Daniel Marjamäki
6f8e42a5af
changed the astyle formatting flags
2011-10-13 20:53:06 +02:00
Daniel Marjamäki
417dc1ff2a
Fixed #3159 (Uninitialized variable false positive)
2011-10-02 20:38:58 +02: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
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
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
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
Daniel Marjamäki
85d83d86ac
Fixed #3060 (False positive: Uninitialized variable: fresh)
2011-09-04 12:53:53 +02:00
Daniel Marjamäki
c7886ca1c4
Fixed #3058 (False positive: Uninitialized variable: data)
2011-09-03 18:53:14 +02:00
Robert Reif
bc4db75aa9
fix #2146 (uninitialized variable: false negative for 'return x ? 1 : y;')
2011-07-31 21:33:43 -04:00
Daniel Marjamäki
5cb701d3c1
Fixed #2946 (False positive: Uninitialized buffer variable (init in subfunction))
2011-07-27 10:34:12 +02:00
Daniel Marjamäki
4e55fb604c
Fixed #2945 (False positive: Uninitialized variable reading from stream)
2011-07-26 21:30:58 +02:00
Daniel Marjamäki
63a0c6ad4a
Fixed #2796 (uninitialized and leaving scope)
2011-07-25 16:35:30 +02:00
Daniel Marjamäki
9a3f95613a
Uninitialized variables: Fixed false positive if there is assignment in return statement
2011-07-24 22:41:40 +02:00
Daniel Marjamäki
1bb7a1c23c
Fixed #2938 (Uninitialized variable not detected when part of expression)
2011-07-24 22:26:11 +02:00
Daniel Marjamäki
982b645ff4
Fixed #2775 (Uninitialized variable: Not detected when uninitialized struct pointer is dereferenced in sub function)
2011-07-04 21:04:32 +02:00
Daniel Marjamäki
b9ee867344
Fixed #2764 (False positive: Uninitialized variable '&(x[0])')
2011-05-05 21:26:18 +02:00
Daniel Marjamäki
e22f69daf4
Fixed #2753 (False negative: dereference uninitialized pointer 'buf[0] = 0;')
2011-04-26 20:26:09 +02:00
Daniel Marjamäki
92ab1ef8e7
fix
2011-02-26 20:08:37 +01:00
Daniel Marjamäki
caca6e94e6
Fixed #2231 (uninitialized variable: undetected when initialization in for loop)
2011-02-19 20:19:46 +01:00
Daniel Marjamäki
ee0f5ff7b3
Uninitialized variables: Added TODO test case
2011-02-12 12:42:16 +01:00
Daniel Marjamäki
26f017e9c6
scripts: added tabs.pl - in my opinion it is bad to use tabs inside string constants. spaces or \t should be used instead.
2011-02-05 12:53:28 +01:00
Daniel Marjamäki
39c68e12ce
Fixed #2533 (false positive: (error) Uninitialized variable: cBuffer)
2011-02-03 22:29:32 +01:00
Pete Johns
098f0bf3e6
Fixed #2526 (Make TODO_ASSERT_EQUALS take three arguments (value, to_be, as_is)?...
...
Removed replaced EXPECTED with...
WANTED (to-be): The future expected value.
CURRENT (as-is): Documenting how cppcheck behaves now.
This removes the need for an ASSERT_EQUALS but enforces the check for every TODO_ASSERT_EQUALS.
2011-01-30 23:20:11 +11:00
Daniel Marjamäki
c04107131b
when using TODO_ASSERT_EQUALS it's a good idea to pair it with a ASSERT_EQUALS
2011-01-23 14:34:26 +01:00
Reijo Tomperi
226b605774
Change year 2010 -> 2011 in license texts.
2011-01-09 21:33:36 +02:00
Daniel Marjamäki
21af64049c
Fixed #2401 (false positive: Uninitialized variable: result)
2011-01-05 20:44:04 +01:00
Daniel Marjamäki
68de938d23
Uninitialized variables. Fixed false positive when there are multiple related conditions. ticket: #2399
2011-01-05 19:54:56 +01:00
Daniel Marjamäki
8bdb05da6e
Uninitialized variables: typeof doesn't dereference. Ticket: #2367
2010-12-30 21:30:46 +01:00
Daniel Marjamäki
d4e3e7e201
Fixed #2367 (false positive: (error) Uninitialized variable: s)
2010-12-27 21:19:10 +01:00
Daniel Marjamäki
448c03c6e6
Fixed #2367 (false positive: (error) Uninitialized variable: s)
2010-12-27 21:05:33 +01:00
Daniel Marjamäki
aff3623fec
Fixed #2345 (False positive: uninitialized variable (in sub-condition in if inside a loop))
2010-12-23 09:16:29 +01:00
Daniel Marjamäki
fc9c450eed
Fixed #2320 (false positive: Uninitialized variable: kbuf)
2010-12-18 10:06:21 +01:00
Daniel Marjamäki
c2335f845e
Fixed #2306 (False positive: array of std::string is reported as uninitialized)
2010-12-17 21:20:04 +01:00
Robert Reif
f12c0c7ada
Tokenizer: add assert(_settings) to Tokenizer to insure the tokenizer always has settings. Ticket: #2219
2010-12-01 18:00:55 +01:00
Daniel Marjamäki
234b1e0098
Fixed #2265 (False positive: Uninitialized variable: path)
2010-11-30 18:40:36 +01:00
Daniel Marjamäki
095f725b3c
Fixed #2218 (False positive: Data is allocated but not initialized)
2010-11-27 17:34:54 +01:00
Daniel Marjamäki
fc57e06cdd
Fixed #2226 (segmentation fault of cppcheck)
2010-11-24 18:08:21 +01:00
Daniel Marjamäki
aa653fe42b
Uninitialized variables: Fixed simple undetected case for '= %var% |' and '| %var% ;'
2010-11-16 20:16:44 +01:00
Daniel Marjamäki
35c72db251
Uninitialized variables: Fixed simple undetected case for '= %var% -'
2010-11-16 20:07:41 +01:00
Daniel Marjamäki
cbdae275ed
Uninitialized variables: Fixed false negative. Ticket: #2207
2010-11-16 20:01:57 +01:00
Daniel Marjamäki
29bb553782
Fixed #2207 (False positive: uninitialized variable (return if uninitialized))
2010-11-15 20:35:01 +01:00
Daniel Marjamäki
6d1c0687c9
Fixed #2202 (false postive: Data is allocated but not initialized: rbdc)
2010-11-15 17:11:08 +01:00
Daniel Marjamäki
47d37e7a05
Uninitialized variables: Fixed false negatives when calling unknown function with uninitialized variable by value: 'f(a+1)'
2010-11-13 15:10:17 +01:00
Daniel Marjamäki
bf15236b9e
Fixed #2196 (False positive: Invalid data is allocated but not initialized (initialization in loop))
2010-11-13 10:33:35 +01:00
Daniel Marjamäki
3303c40879
uninitialized variables: fixed problem when parsing loop bodies
2010-11-13 08:03:59 +01:00
Daniel Marjamäki
9d7a623985
Uninitialized variables: Passing uninitialized array as parameter to function. Ticket: #2188
2010-11-12 17:38:25 +01:00
Daniel Marjamäki
e523d5a3a3
Fixed #914 (improve check: usage of uninitialized variable)
2010-11-12 17:14:37 +01:00
Daniel Marjamäki
1204043556
Fixed #2148 (uninitialized variable: false negative, function parameter that is passed by value)
2010-11-12 17:06:14 +01:00
Daniel Marjamäki
6b489230e8
Fixed #2188 (Does not detect initialization)
2010-11-12 16:11:44 +01:00
Daniel Marjamäki
624ce205b9
Fixed #2185 (False negative: when constant is undefined a 'dangerous usage of strncpy' is not found)
2010-11-10 20:20:05 +01:00
Daniel Marjamäki
65c7b6eb8b
Uninitialized variables: better handling of for example 'a[1] = 1+a[2];'
2010-11-05 19:24:14 +01:00
Daniel Marjamäki
a90a7202cb
Uninitialized variables: detect usage of dead pointer: '*p += 10'
2010-11-05 17:04:41 +01:00
Daniel Marjamäki
d21974777c
Fixed #2161 (false positive: assigned a value that is never used)
2010-11-04 20:16:17 +01:00
Daniel Marjamäki
dd4b2b8b46
Tokenizer: simplify 'x[0] += 1;'
2010-11-02 19:22:48 +01:00
Daniel Marjamäki
bc283d8b99
Uninitialized variables: Broke out the checking into separate file
2010-10-31 12:31:11 +01:00