Robert Reif
2bdcf3b5b2
variable usage: refactoring the checking
2010-04-24 09:45:03 +02:00
Robert Reif
99a7755218
tokenizer improvements: remove calling convention ( #1619 )
2010-04-24 09:40:05 +02:00
Zachary Blair
5835b2665b
Fixed #1169 (improve check: divsion by zero not detected when using the shift (>>) operator)
2010-04-23 22:59:53 -07:00
Daniel Marjamäki
a3b781a181
Fixed #819 (array index out of bounds not detected for multidimension arrays)
2010-04-23 16:26:40 +02:00
Robert Reif
f4ce5a37d7
Fixed #1615 (False positive - C-style pointer casting)
2010-04-22 20:08:29 +02:00
Daniel Marjamäki
7d391b37c9
astyle formatting
2010-04-22 20:07:41 +02:00
Daniel Marjamäki
eda18004bd
Cleanup CheckBufferOverrun
2010-04-22 19:58:44 +02:00
Daniel Marjamäki
e28dbda5fa
Refactoring: Improved the checkFunctionCalls, warning when size argument is given through char constant
2010-04-22 19:55:07 +02:00
Daniel Marjamäki
c0d0b0f63f
Refactoring: Moved function call check to checkFunctionCalls
2010-04-22 19:49:02 +02:00
Daniel Marjamäki
b9d8f52cca
CheckBufferOverrun: Fixed false positives caused by refactorings
2010-04-22 19:22:23 +02:00
Zachary Blair
680a470741
Fixed #1564 (CppCheck does not recognise redundant IF)
2010-04-22 01:21:54 -07:00
Robert Reif
90541386da
Fixed #1619 (tokenizer: remove calling convention)
2010-04-21 21:08:47 +02:00
Daniel Marjamäki
f378b382a0
CheckBufferOverrun: simplify checking of read|write problems
2010-04-21 20:06:59 +02:00
Daniel Marjamäki
f9f6927e63
CheckBufferOverrun: Don't give false positives when reading from array with strncpy/strncat
2010-04-21 20:02:58 +02:00
Daniel Marjamäki
f057e127a0
CheckBufferOverrun: Refactoring the checking of function calls
2010-04-21 19:27:28 +02:00
Daniel Marjamäki
798aa84151
Refactoring: CheckBufferOverrun refactorings. split up the checkScope into two separate functions. The ArrayInfo usage was improved. Also broke out for-loop handling into separate functions.
2010-04-21 18:33:21 +02:00
Zachary Blair
c26e619b23
Fixed #855 (Refactoring: move conditions into checks)
2010-04-20 23:38:25 -07:00
Reijo Tomperi
96d66af478
Change "Array index -1 corresponds with 4294967295..." error message into "Array index -1 is out of bounds"
2010-04-20 21:44:31 +03:00
Daniel Marjamäki
7e2f39290d
Fixed #1614 (negative array index issues in latest from git)
2010-04-20 16:43:51 +02:00
Reijo Tomperi
97fea180b5
astyle fix
2010-04-18 22:03:03 +03:00
Daniel Marjamäki
b6ab419a06
Buffer Overrun: Broke out the checking for negative array index
2010-04-18 20:51:39 +02:00
Daniel Marjamäki
af3f2faa41
Refactoring: Renamed ArrayInfo::type_size to ArrayInfo::element_size
2010-04-18 20:18:25 +02:00
Daniel Marjamäki
1ae5a89982
Refactoring: Reusing the ArrayInfo in CheckBufferOverrun
2010-04-18 20:06:54 +02:00
Daniel Marjamäki
814f706329
BufferOverflow: Refactoring ArrayInfo
2010-04-18 19:46:45 +02:00
Robert Reif
76a683a73a
Fixed #1602 (functions defined in header outside of class cannot be const)
2010-04-18 15:40:31 +02:00
Daniel Marjamäki
a473345f18
Buffer overruns: First change to detect overruns in multidimensional arrays ( #819 )
2010-04-18 11:08:29 +02:00
Robert Reif
bee4608b27
Fixed #1613 (False -s positive: Template instantiation hides typedef with same name)
2010-04-18 09:13:55 +02:00
Robert Reif
d90f59051c
Fixed #1612 (false positive: The function can be const)
2010-04-18 07:53:39 +02:00
Robert Reif
d851b4a3d4
Fixed #1607 (false positive: variable is assigned a value that is never used)
2010-04-17 14:23:29 +02:00
Daniel Marjamäki
9cd8bd842e
STL: fixed false negative when erasing invalidated iterator
2010-04-17 13:37:04 +02:00
Daniel Marjamäki
b19113426f
Unused struct member: Fixed false positives
2010-04-17 11:16:05 +02:00
Daniel Marjamäki
c0e9a546f7
Refactoring: Refactoring the Settings class
2010-04-17 09:23:54 +02:00
Daniel Marjamäki
3bab5f6bd6
Borland C++: Fixed compiler errors
2010-04-17 07:25:53 +02:00
Daniel Marjamäki
c9fb5f87e0
Fixed #1600 (false positive: After insert, the iterator 'aI' may be invalid)
2010-04-16 16:56:55 +02:00
Reijo Tomperi
10a7c3f70c
Fix --template to work again
2010-04-16 17:26:49 +03:00
Robert Reif
61b5a21ac9
Fixed #1605 (false positive: uninitialized variable)
2010-04-16 16:25:57 +02:00
Robert Reif
45573ad101
Fixed #1607 (false positive: variable is assigned a value that is never used)
2010-04-16 15:57:09 +02:00
firewave
43dd749cc6
Fix #1585 (--append doesn't work with TAB formating)
2010-04-15 22:45:38 +02:00
Reijo Tomperi
15e4b8dbd5
Fix #1595 (case marks improperly tokenized with macro)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1595
2010-04-15 23:21:00 +03:00
Daniel Marjamäki
c718a7c595
astyle: Update to astyle 1.24
2010-04-15 20:08:51 +02:00
Daniel Marjamäki
3fa2137ee3
Fixed #1596 ('Index out of bounds' false positive)
2010-04-15 19:09:19 +02:00
Robert Reif
01aa414f32
Fixed #1253 (improve check: uninitialized variable not found when using reference)
2010-04-15 18:44:52 +02:00
Robert Reif
176795ef95
Another fix for #1601 (change simplifyInitVar to split declaration from initialization)
2010-04-15 18:42:11 +02:00
Zachary Blair
2e276576a4
Fixed #1526 (Cppcheck checks redundant configurations)
2010-04-15 18:37:51 +02:00
Robert Reif
d2bb4964d0
Fixed #1588 (typedef struct incorrectly simplified)
2010-04-14 19:06:51 +02:00
Robert Reif
3bbb2e1d7f
Fixed #1601 (change simplifyInitVar to split declaration from initialization)
2010-04-14 19:04:16 +02:00
firewave
8e20d5b08d
Added Visual Studio 2010 soultion and project files
2010-04-14 12:05:10 +02:00
firewave
e3e2ee35aa
Disabled link time code generation for debug builds. Enabled .pdb generation for release builds.
2010-04-14 12:01:45 +02:00
firewave
4a5463d533
Merge branch 'master' of github.com:danmar/cppcheck
2010-04-13 22:24:12 +02:00
firewave
efd18e3d42
More cleanups to the Visual Studio projects. All options are now in line. Also enabled some default options like intrinsic functions, buffer checks and lick time code generation.
2010-04-13 22:22:44 +02:00
Reijo Tomperi
0912836c25
Fix: sizeof(char*) was not simplified correctly
2010-04-13 23:17:27 +03:00
Reijo Tomperi
4a33b226e6
Fix #1599 (false positive on if( (f = fopen("foo", "r")) == ((FILE*)NULL) ))
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1599
2010-04-13 22:57:52 +03:00
firewave
bffc097ab3
Moved shared files to seperate lib project
2010-04-13 21:40:00 +02:00
Reijo Tomperi
35d2a27b9c
Update copyright year in all source files
2010-04-13 22:23:17 +03:00
Reijo Tomperi
30ba3d1aee
Change some files to UTF-8
2010-04-13 21:57:41 +03:00
Reijo Tomperi
a33e8f34c5
Disable "Overall time" output when --showtime is not used
2010-04-13 21:27:47 +03:00
Daniel Marjamäki
8373a6d4cb
astyle formatting
2010-04-13 19:30:51 +02:00
Zachary Blair
bd7dc9946e
Fixed #1530 (possible new check: strlen return value versus zero.)
2010-04-13 19:30:25 +02:00
Daniel Marjamäki
a7903c3385
dos2unix
2010-04-13 19:25:08 +02:00
firewave
8966888a92
Fixed some VS2008 warnings
2010-04-13 11:31:27 +02:00
firewave
89cdb088d6
More --showtime updates:
...
- removed "average"
- added number of results, average processing time and overall time to non-"file" output
2010-04-13 11:23:11 +02:00
Oliver Stoeneberg
f992ac7da7
showtime: refactoring and improving. Added summary/file/top5/average options.
2010-04-12 22:13:42 +02:00
Daniel Marjamäki
38a3fe37f9
Revert "Optimization: Made Tokenizer::setVarId a bit faster by temporarily assigning 'string id'. This means less string comparisons are needed."
...
This reverts commit 4b8080e425
.
2010-04-12 21:17:31 +02:00
Reijo Tomperi
d102369196
Fix #1590 (False negative: Array index out of bounds: "0 <= i")
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1590
2010-04-12 22:04:59 +03:00
Oliver Stoeneberg
cd859a59f2
Fixed #1591 (Patch to increase --showtime resolution)
2010-04-12 19:41:02 +02:00
Robert Reif
67fafd4028
Fixed #1588 (typedef struct incorrectly simplified)
2010-04-12 19:05:31 +02:00
Reijo Tomperi
cfc5f61e11
Merge branch 'master' of git@github.com:danmar/cppcheck
2010-04-11 22:56:31 +03:00
Reijo Tomperi
9a4cbe0540
Changed CppCheck::parseFromArgs() to return boolean value and reportOut() in case of error.
...
It used to throw exception and return error message with the exception.
2010-04-11 22:53:21 +03:00
Daniel Marjamäki
4b8080e425
Optimization: Made Tokenizer::setVarId a bit faster by temporarily assigning 'string id'. This means less string comparisons are needed.
2010-04-11 21:37:35 +02:00
Daniel Marjamäki
6f74c0af5e
Fixed #1587 (Crash while processing file)
2010-04-11 20:57:30 +02:00
Reijo Tomperi
d1f22d50e6
Fix last of the -Wshadow warnings.
2010-04-11 14:49:50 +03:00
Daniel Marjamäki
1f022e281f
Fixed SIGABRT in new checking
2010-04-10 21:28:49 +02:00
Daniel Marjamäki
5fed938f56
Fixed #1190 (array index out of bounds when index variable is assigned in a condition)
2010-04-10 21:12:00 +02:00
Daniel Marjamäki
96ba41b009
Cppcheck Help: Removed information about --auto-dealloc because it is not relevant at the moment.
2010-04-10 15:05:59 +02:00
Daniel Marjamäki
2d41e31cdd
Cppcheck: Deprecated the command line options -a, --all and --enable=possibleError
2010-04-10 14:54:49 +02:00
Daniel Marjamäki
e9b4ea44a2
Refactoring: Disable inconclusive checks. They can still be activated for debugging/testing purposes
2010-04-10 14:05:33 +02:00
Daniel Marjamäki
7763d25847
Fixed #1357 (problem in stl insert method of set template)
2010-04-10 10:22:34 +02:00
Zachary Blair
3152816619
Fixed #779 (Tokenizer: delete register keyword everywhere)
2010-04-10 09:58:09 +02:00
Daniel Marjamäki
21717e05cd
Refactoring: use more specific conditions instead of std::isupper. Only the A-Z are interesting. This also fixes compiler errors.
2010-04-10 09:46:50 +02:00
Daniel Marjamäki
b4e9185177
Fixed #1134 (improve check: pointer access out of bounds not detected (allocated with malloc))
2010-04-10 07:57:29 +02:00
Reijo Tomperi
6dc3860ae9
Fix more -Wshadow compile warnings
2010-04-09 22:40:37 +03:00
Daniel Marjamäki
f77dbbb14b
Fixed some false positives for unused struct members
2010-04-09 19:55:41 +02:00
Daniel Marjamäki
d360c01675
Fixed #1579 (False positive: function can be const when return type is unknown)
2010-04-09 19:15:39 +02:00
Daniel Marjamäki
1328a57103
Fixed #1584 (False positive: (static) Member variable not assigned a value in operator=)
2010-04-09 18:35:54 +02:00
Daniel Marjamäki
38a28e28ec
Fixed #1581 (False positives 'The scope of the variable x can be reduced')
2010-04-09 16:53:27 +02:00
Martin Ettl
f6a526c8c8
reduced -Wshadow warnings from gcc-4.4
2010-04-08 22:56:34 +02:00
Daniel Marjamäki
9a4707c025
Fixed #1576 ('Index out of bounds' false positive)
2010-04-08 19:57:38 +02:00
Daniel Marjamäki
1b81a9d435
Fixed #1537 ('Unused private function' when using pointer to member function)
2010-04-08 19:06:54 +02:00
Daniel Marjamäki
26c447279c
astyle formatting
2010-04-08 17:41:22 +02:00
Robert Reif
bc0a318b6d
Fixed #1580 (unnamed anonymous struct can segfault)
2010-04-08 17:40:23 +02:00
Martin Ettl
e23197a527
fixed ticket 1578, class Filelister had no virtual dtor
2010-04-07 23:07:03 +02:00
Reijo Tomperi
fcf532ccaf
Fix some -Wshadow compile warnings
2010-04-06 23:17:23 +03:00
Daniel Marjamäki
cd2f8f6838
Merge branch 'master' of git://github.com/czw/cppcheck
2010-04-06 22:12:11 +02:00
Reijo Tomperi
7caaee3739
Fix some of the warnings that appear with -Wshadow
2010-04-06 22:53:05 +03:00
Reijo Tomperi
5aa88ee5a2
Fix vs warnings. Apply patch from kidkat.
2010-04-06 21:35:21 +03:00
Reijo Tomperi
8ce5379299
Fix: warning C4138: '*/' found outside of comment
2010-04-06 21:07:46 +03:00
Reijo Tomperi
c28b365ea0
astyle fix
2010-04-06 16:56:06 +03:00
Jens Bäckman
9ae714661b
Fix a rare crash with oddly formatted source files
2010-04-06 14:23:17 +02:00
Martin Ettl
c4d1d47f6b
fixed ticket 997, now fread and fwrite checked for bufferoverrun
2010-04-06 13:55:03 +02:00
Reijo Tomperi
d3c251f53a
Refactor and fix "After a strncpy() the buffer should be zero-terminated" checking,
2010-04-05 21:47:50 +03:00
Martin Ettl
4bc325f077
#ticket 1513: added sqrt() support
2010-04-05 20:20:20 +02:00
Reijo Tomperi
93d195aa0f
astyle fix
2010-04-05 21:12:43 +03:00
Martin Ettl
f895ab9a0d
Merge branch 'master' of git@github.com:danmar/cppcheck
2010-04-05 20:08:21 +02:00
Martin Ettl
fe7c6aed9f
#ticket 1513: added pow() support
2010-04-05 20:07:53 +02:00
Reijo Tomperi
04b38e5428
astyle fix
2010-04-05 20:57:54 +03:00
Martin Ettl
218c18496d
#ticket 1513 added fmod() support
2010-04-05 19:45:33 +02:00
Martin Ettl
d4923e2a92
added atan2() check to ticket #1513
2010-04-05 19:35:56 +02:00
Daniel Marjamäki
b62ac149b5
Cleanup: Removed unused code from CheckMemoryLeak
2010-04-05 18:37:46 +02:00
Daniel Marjamäki
61e1c4183f
Uninitialized variables: better handling of 'a[b[..]]' when b is not initialized
2010-04-05 09:04:30 +02:00
Kimmo Varis
5766e83309
Improve ifdeffing.
2010-04-05 09:48:19 +03:00
Daniel Marjamäki
d26a2cfc16
Uninitialized variables: Detect reading uninitialized data through array/pointer variable
2010-04-05 08:38:26 +02:00
Reijo Tomperi
6db663f6de
Fix #1322 (Add cppcheckError and unusedFunction to --errorlist, give out internal errors in xml)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1322
2010-04-04 23:55:28 +03:00
Daniel Marjamäki
abceff497b
Refactoring: some refactoring of ExecutionPath. The foundError was removed. No automatic bailout of all checks are made when errors are found.
2010-04-04 11:24:52 +02:00
Daniel Marjamäki
78852b08ab
Fixed #1566 (false negative: uninitialized variable)
2010-04-04 09:17:53 +02:00
Daniel Marjamäki
849be383e6
Tokenizer: tokenize 1E-2 into a single token
2010-04-04 08:01:05 +02:00
Reijo Tomperi
be598757a1
Fix segmentation fault when calling with --errorlist and add a testcase for it.
2010-04-03 22:53:06 +03:00
Daniel Marjamäki
a8f566bfcd
Cleanup: Removed redundant simplification in checkmemoryleak.cpp
2010-04-03 20:47:38 +02:00
Daniel Marjamäki
6acb304ef2
Cleanup: Removed unfinnished checking of std::find
2010-04-03 15:33:13 +02:00
Daniel Marjamäki
8a8547e6b7
astyle formatting
2010-04-03 14:28:32 +02:00
Daniel Marjamäki
a4144b9d18
Refactoring: Moved copy/paste code in Tokenizer
2010-04-03 09:54:10 +02:00
Daniel Marjamäki
f8367da1fd
Refactoring: broke out copy/pasted code
2010-04-03 09:17:16 +02:00
Daniel Marjamäki
5f9e14e242
Borland C++: Fixed compiler error
2010-04-03 07:51:40 +02:00
Reijo Tomperi
38d64d0520
astyle fix
2010-04-02 23:44:24 +03:00
Martin Ettl
622663b8db
added a helper function to mathlib::isNullValue(), it checks wheter a string has a null representation or not and returns a boolian result; extended nullchecks in testmathlib.cpp
2010-04-02 22:41:54 +02:00
Daniel Marjamäki
427d155644
Fixed #1527 (Function can't be const if it has non-const operator overload call)
2010-04-02 22:03:07 +02:00
Reijo Tomperi
93d4851040
astyle fix
2010-04-02 22:17:09 +03:00
Martin Ettl
f36af278d0
#ticket #1513 added asin() support
2010-04-02 21:02:39 +02:00
Martin Ettl
0c2f4831d8
#ticket #1513 added asin() support
2010-04-02 20:59:39 +02:00
Daniel Marjamäki
ff38bbf468
Cleanup: The Tokenizer doesn't need to handle UTF in code nor multiline string. That is handled in the Preprocessor.
2010-04-02 20:48:32 +02:00
Reijo Tomperi
a1d0defbc0
astyle fix
2010-04-02 21:42:06 +03:00
Martin Ettl
5a21fe7ae8
Merge branch 'master' of git@github.com:danmar/cppcheck
2010-04-02 20:24:04 +02:00
Daniel Marjamäki
1d1d79a1e5
Cleanup: Removed unused %name% cmd for patterns
2010-04-02 20:25:13 +02:00
Martin Ettl
c391a03db6
added acos() check to ticket #1513 ; added testcases for MathLib::toDoubleNumber(), now double conversion of zeros is handled correctly; changed assertEquals() function of testsuite parameters from unsigned int to double. This is needed to avoid overflow of unsigned int by comparing negative floating point values.
2010-04-02 20:23:37 +02:00
Daniel Marjamäki
c6bbc9d739
Fixed #1565 (False positive: Uninitialized variable 'B::j'. There are 2 classes with the name 'B')
2010-04-02 19:29:54 +02:00
Martin Ettl
9788333ee9
added log10() check, for checking about parameters passed to mathfunctions that do not make sense
2010-04-02 19:17:41 +02:00
Robert Reif
805c683c1a
Cleanup: Removed unneeded code
2010-04-02 18:55:27 +02:00
Daniel Marjamäki
734b10e650
Fixed #1479 (false positive: unintialized variable when using goto)
2010-04-02 08:35:05 +02:00
Robert Reif
3507b06e0b
Fixed #1563 (false positive: function can be const (assignment to static))
2010-04-02 08:02:47 +02:00
Robert Reif
1dcbf02bd8
Fixed #1553 (false positive : uninitialized variable for struct timeval from <sys/time>)
2010-04-02 07:36:18 +02:00
Daniel Marjamäki
8b5aae9adb
astyle formatting
2010-04-02 07:32:03 +02:00
Daniel Marjamäki
0cad22314e
Reverted 'astyle fix'. Those changes are not in sync with my astyle configuration/setup.
2010-04-02 07:30:58 +02:00
Martin Ettl
193aa7d1d3
astyle fix
2010-04-02 02:21:53 +02:00
Martin Ettl
b5fb01c202
ticket #1513 new check: Detecting obviously wrong math call arguments passed to math functions)
2010-04-02 02:19:38 +02:00
Reijo Tomperi
c7d36b73ed
Fix #1548 (False positive: array index out of bounds in for-loop)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1548
2010-04-01 22:35:36 +03:00
Robert Reif
2825773918
Fixed #1552 (false positive: function can be const (array of struct))
2010-04-01 17:01:52 +02:00
Robert Reif
2c5fb55c3b
Fixed #1551 (false positive: The function 'A::vSet' can be const)
2010-04-01 16:59:35 +02:00
Robert Reif
a8c9aa1f8d
Fixed #1550 (Improve check: Assignment to self)
2010-04-01 16:40:12 +02:00
Reijo Tomperi
c460c16cee
Fix cross compiling in Linux
...
Change: #include "fileLister_win32.h" -> #include "filelister_win32.h"
2010-03-31 22:54:35 +03:00
Daniel Marjamäki
a68d8dbc77
Fixed #1549 (false positive: uninitialized variable)
2010-03-31 20:20:51 +02:00
Robert Reif
78e54e17f2
Unit testing: Added test case for memset. Ticket: #1538
2010-03-31 19:53:53 +02:00
Robert Reif
ef57d01f7a
Fixed #1492 (false negatives: array index out of bounds)
2010-03-31 17:14:49 +02:00
Robert Reif
7fb5b9b67b
Better checking for assignment to self. Ticket: #1550
2010-03-31 17:09:59 +02:00
Robert Reif
32e597e343
Fixed #1539 (False positive: possible error Array index out of bounds)
2010-03-30 17:33:17 +02:00
Daniel Marjamäki
c213227133
Fixed #1535 (False positive: member variable not initialized, struct with constructor)
2010-03-29 20:34:47 +02:00
Robert Reif
0bddd1977f
Fixed #1536 (###### If you see this, there is a bug ###### Token::Match() - varid was 0)
2010-03-29 17:25:38 +02:00
Daniel Marjamäki
c3edc5fd89
Fixed #1148 (improve check: usage of uninitialized variables)
2010-03-28 21:27:06 +02:00
Daniel Marjamäki
9656379ffb
Merge branch 'master' of git@github.com:danmar/cppcheck
2010-03-28 15:56:38 +02:00
Robert Reif
62d2845014
Fixed #1492 (false negatives: array index out of bounds)
2010-03-28 15:56:13 +02:00
Reijo Tomperi
417f14fccf
Fix #1534 (False positive with #elif (defined NAME))
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1534
2010-03-28 15:15:25 +03:00
Robert Reif
2dc4222c9a
Refactoring: Added CheckClass::isMemberFunc
2010-03-28 11:46:42 +02:00
Daniel Marjamäki
16124ce646
Fixed #1516 (C++Builder properties mistaken for uninitialized variables)
2010-03-28 10:58:03 +02:00
Daniel Marjamäki
c7867af3c5
Fixed #1533 (False positive: Uninitialized variable)
2010-03-28 10:42:37 +02:00
Reijo Tomperi
86fabd03b3
Fix #1532 (hang due to commit 772aa95c8a
)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1532
2010-03-27 21:52:31 +02:00
Martin Ettl
e4bda66b28
extended The function can be const test
2010-03-27 14:11:46 +01:00
Robert Reif
c50469dba6
Fixed #1523 (false negative:: buffer access out of bounds when using shift operator)
2010-03-27 07:21:08 +01:00
Reijo Tomperi
0cc84bd2be
Partial fix for #1475 (False positive: Not enough parameters for macro: #define A(a, b...))
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1475
2010-03-26 22:11:49 +02:00
Robert Reif
2eceaaefc0
Fixed #1519 (false negative: the function can be declared as const)
2010-03-26 20:14:31 +01:00
Robert Reif
45865f54a8
Fixed #1525 (false negative: the function can be declared as const (member declared as mutable))
2010-03-26 19:06:00 +01:00
Robert Reif
307000b448
Fixed #1529 (false positive: function can be const (struct member variable))
2010-03-26 18:16:33 +01:00
Daniel Marjamäki
258e7e292e
Fixed #1496 (false positive: Member variable not initialized in the constructor 'X::m_d')
2010-03-26 17:19:33 +01:00
Raphael Geissert
c0e09c4cb3
Fixed #1511 (false negative null pointer deref when dereferencing pointers to constants)
2010-03-26 16:44:46 +01:00
Robert Reif
a1528d3154
Fixed #1522 (false positive: function can be const (assignment in return))
2010-03-26 16:30:30 +01:00
Daniel Marjamäki
80edb4d8f4
Tokenizer: Simplify 'false ==' to '!'
2010-03-24 19:55:02 +01:00
Robert Reif
e95bc41e59
Fixed #1522 (false positive: function can be const (assignment in return))
2010-03-24 19:31:30 +01:00
Robert Reif
9808a59cc1
Fixed #1515 (false positive: The function 'wxThreadInternal::SetExitCode' can be const)
2010-03-23 07:37:20 +01:00
Robert Reif
637a34bfd2
Fixed #1517 (false negative: the function can be declared as const)
2010-03-23 07:34:34 +01:00
Daniel Marjamäki
5b1b845750
Fixed #1504 (False positive: Cppcheck incorrectly reports that extern variable is not initialized)
2010-03-20 08:03:18 +01:00
Daniel Marjamäki
3d90559035
Fixed #1386 and #1387 (False positives given by CheckMemoryLeakInFunction when temporary and member variable don't have the same allocation and deallocation)
2010-03-20 07:50:52 +01:00
Daniel Marjamäki
f687e85be5
Fixed #1498 (false positive: The function 'V<unsigned>::vSet' can be const)
2010-03-19 19:34:26 +01:00
Robert Reif
0fb680d887
Tokenizer: remove unnamed anonymous structures and unions ( #1493 )
2010-03-19 19:04:56 +01:00
Robert Reif
92fe14e7f0
Fixed #1491 (False positive when putting an access specifier at the end of a class declaration)
2010-03-19 17:40:23 +01:00
Daniel Marjamäki
54c5d53eac
Fixed #1428 (False positive: (possible error) Memory leak when memory deleted in destructor)
2010-03-19 16:57:23 +01:00
Robert Reif
9c2248254e
Here is a patch that adds support for derived structs and fixes a bug that missed some nested structs. ( #1493 )
2010-03-19 16:17:25 +01:00
Raphael Geissert
d11004fa3d
Fixed #1512 (incorrect handling of ndefs in the preprocessor)
2010-03-19 16:13:45 +01:00
Daniel Marjamäki
c7bd437d7d
astyle formatting
2010-03-19 16:12:51 +01:00
Daniel Marjamäki
95d22de690
Fixed #1508 (false positive : uninitialized variable)
2010-03-18 19:23:38 +01:00
Daniel Marjamäki
45987e5e9f
doxygen: some updates to the lib/checkother
2010-03-18 18:59:55 +01:00
Robert Reif
5ea7e32bf9
Partial fix for #1493 (false positives: function can be const and struct or union member is never used)
2010-03-18 18:14:52 +01:00
Daniel Marjamäki
e911d1f1df
doxygen updates
2010-03-17 22:16:18 +01:00
Daniel Marjamäki
89719b023e
unit testing: made Tokenizer functions public so they can be unit tested
2010-03-17 22:08:02 +01:00
Daniel Marjamäki
1d0cd9c267
refactoring: no need to hide functions because the definition isn't seen by the core program anyway.
2010-03-17 21:26:56 +01:00
Robert Reif
b3856cbc5e
Fixed #1506 (typedef name hiding check combined with forward declaration leeds to false positive)
2010-03-17 17:31:08 +01:00
Daniel Marjamäki
12c45a1aba
Fixed #1476 (false positive: Uninitialized variable)
2010-03-16 19:53:09 +01:00
Daniel Marjamäki
235404077f
Fixed #1501 (false positive: Variable 'n' is assigned a value that is never used)
2010-03-16 19:25:10 +01:00
Daniel Marjamäki
15d67a2369
Fixed #1503 (False positive for uninitialized variable)
2010-03-16 19:09:37 +01:00
Robert Reif
89c57c72c5
small const fix
2010-03-16 07:31:40 +01:00
Daniel Marjamäki
9d822c77aa
doxygen: Some comments for CheckOther, added @todo to Token::Match
2010-03-14 19:11:03 +01:00
Daniel Marjamäki
933289a6d7
doxygen: updated comments for Cppcheck and FileLister
2010-03-14 18:55:33 +01:00
Daniel Marjamäki
382e41d92a
Fixed #1494 (Improve Tokenizer::simplifyKnownVariables to handle for loops better)
2010-03-14 09:57:34 +01:00
Daniel Marjamäki
7bcb7897e4
doxygen: fixed error messages
2010-03-14 07:48:44 +01:00
Daniel Marjamäki
e4a45aefe2
doxygen: fixed warning messages
2010-03-13 22:16:06 +01:00
Daniel Marjamäki
c5e0104ab8
doxygen: updated comments for ErrorLogger and Severity
2010-03-13 21:49:09 +01:00
Daniel Marjamäki
30d3418b11
doxygen: added more comments for CheckNullPointer and CheckUninitVar
2010-03-13 21:42:59 +01:00
Daniel Marjamäki
9b550a3f87
doxygen: added comments
2010-03-13 21:12:18 +01:00
Daniel Marjamäki
9fe9be1ea9
Fixed #1465 (false positive: unintialized class member)
2010-03-13 20:24:39 +01:00
Daniel Marjamäki
65ae37de2f
Fixed #1460 (false positive: memory leak when using throw no_memory)
2010-03-13 17:11:48 +01:00
Daniel Marjamäki
772aa95c8a
Fixed #1477 (false positive: Uninitialized variable when pointer given to struct)
2010-03-13 11:52:48 +01:00
Robert Reif
846a3a0186
Fixed #1491 (False positive when putting an access specifier at the end of a class declaration)
2010-03-13 08:06:20 +01:00
Robert Reif
f552ca5462
Fixed #1482 (Improve check const-function: function can be made const when assignment not to member variable (false negative))
2010-03-12 18:30:20 +01:00
Kimmo Varis
4cad4410ba
Fix ignoring filelister_unix.cpp code in Windows.
2010-03-12 17:28:55 +02:00
Daniel Marjamäki
7ea37de329
astyle formatting
2010-03-12 07:23:53 +01:00
Kimmo Varis
a7996ab252
Fix compiling in Linux. Fix compiling dmake.
2010-03-11 22:15:15 +02:00
Kimmo Varis
9b16fd7be4
Add Unix/Linux version of FileLister and do some cleanups.
2010-03-11 22:12:27 +02:00
Kimmo Varis
27d06855b4
Remove Win32 implementation from common file.
2010-03-11 21:58:59 +02:00
Kimmo Varis
d1bbcf1734
Implement Win32 FileLister as separate class.
...
Improve the system used to have separate versions of code of FileLister for
Win32 and Linux. New idea is to have Base FileLister class implementing
common code and then derived classes for Win32 and Linux specific code.
FileLister is not anymore a static class. Instead we use singleton of
derived class.
2010-03-11 21:58:59 +02:00
Daniel Marjamäki
587081cab5
Fixed #1488 (Invalid warning about shadowed variable)
2010-03-10 16:47:39 +01:00
Robert Reif
09ab841789
Fixed #1486 (--errorlist shows two identical id values)
2010-03-10 07:47:01 +01:00
Daniel Marjamäki
0f43ce4743
updated version to 1.42
2010-03-09 19:05:28 +01:00
Daniel Marjamäki
04ff061bbb
astyle formatting
2010-03-09 12:41:40 +01:00
Daniel Marjamäki
5d68952bd2
checkbufferoverrun: Refactorings
2010-03-09 12:04:22 +01:00
Daniel Marjamäki
0597026f13
Revert "checkbufferoverrun: Fixed signedness compiler warnings"
...
This reverts commit 3123de346c
.
This commit caused failed tests
2010-03-09 11:03:45 +01:00
Daniel Marjamäki
3123de346c
checkbufferoverrun: Fixed signedness compiler warnings
2010-03-09 10:56:31 +01:00
Daniel Marjamäki
dbc235bd39
Function constness: I don't think it's necessary to show both definition and implementation location. I changed so only the location of the definition is shown. This fixes #1486 .
2010-03-09 07:29:03 +01:00
Reijo Tomperi
a0d6da506b
Fix #1485 (cppcheck.exe 1.41 crashes when calling with option --errorlist)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1485
2010-03-08 22:40:50 +02:00
Daniel Marjamäki
071aefbb58
1.41: Set version in files
2010-03-07 16:25:37 +01:00
Daniel Marjamäki
770d2ff835
Simplify enum: Fixed segmentation fault if code ends with enum type id
2010-03-07 13:01:56 +01:00
Daniel Marjamäki
fa493b7fd1
Fixed #1474 (segmentation fault of cppcheck)
2010-03-07 12:50:45 +01:00
Daniel Marjamäki
7f42ed3ad0
Fixed #1472 (false positive: Data is allocated but not initialized: service)
2010-03-07 09:08:52 +01:00
Reijo Tomperi
b88126a669
Fix #1469 (False positive: Resource leak when fclose() is inside while)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1469
2010-03-06 16:28:52 +02:00
Daniel Marjamäki
fe30c1ca9d
Fixed #1432 (false positive: uninitialized variable)
2010-03-06 13:48:43 +01:00
Reijo Tomperi
237fdbc653
Fix #1454 (False positive: arrayindexoutofbounds, static member sharing local name)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1454
2010-03-06 14:35:04 +02:00
Robert Reif
7c283d1321
Fixed #1321 (Improve check const-function: function that is not implemented inline can be made const)
2010-03-05 17:06:25 +01:00
Daniel Marjamäki
4bb5272760
Fixed #1466 (false positive: Invalid number of character ({) when these macros are defined: '')
2010-03-04 18:51:25 +01:00
Daniel Marjamäki
d643bbe864
simplify templates: show debug message when bailout out
2010-03-04 18:20:08 +01:00
Daniel Marjamäki
b55a7f2815
SimplifyTemplates: some simple refactoring so template name is properly seen. If it's not properly handled then bailout. Related with #1464
2010-03-04 17:34:14 +01:00
Reijo Tomperi
d881fd7a31
Partial fix #1464 (takes too long (days) to process some files)
...
Fix template functions that return "&T".
http://sourceforge.net/apps/trac/cppcheck/ticket/1464
2010-03-03 23:02:32 +02:00
Daniel Marjamäki
e207da18a2
STL: don't warn about the suspicious string::find condition because it's not always a bug
2010-03-03 17:11:31 +01:00
Reijo Tomperi
75c0ed7e6e
Add simple debug print to make it possible to detect cases where template simplification goes wrong.
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1464
2010-03-02 23:55:05 +02:00
Daniel Marjamäki
e064208f54
Preprocessor: Removed unused function renameMacroVariables
2010-02-28 16:10:21 +01:00
Daniel Marjamäki
9b1e6c80ed
STL: refactorings
2010-02-28 08:03:22 +01:00
Daniel Marjamäki
248b6aa159
cleanup: removed unused variables
2010-02-28 07:38:07 +01:00
Daniel Marjamäki
6ca4b008d0
null pointer: Fixed better error message for 'possible null pointer' + removed redundant check in our Tokenizer.
2010-02-28 07:26:50 +01:00
Daniel Marjamäki
4407aabe55
STL: suspicious condition when using std::find
2010-02-28 07:04:58 +01:00
Daniel Marjamäki
980a810995
STL if find: check given severity
2010-02-28 06:56:47 +01:00
Reijo Tomperi
88840e6a08
Fix #1453 (possible infinite loop processing GNU Go's engine/montecarlo.c)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1453
2010-02-27 23:47:56 +02:00
Daniel Marjamäki
4de700c9de
STL: suspicious condition when using find on strings and containers
2010-02-27 21:26:11 +01:00
Daniel Marjamäki
50210857a6
Fixed #1439 (false positive: memory leak when using realloc)
2010-02-27 19:41:14 +01:00
Daniel Marjamäki
c9ff53fbed
Refactoring error messages
2010-02-27 17:06:33 +01:00
Daniel Marjamäki
0a2f631b14
Fixed #1448 (Trying to check Unicode file prints confusing error)
2010-02-27 13:08:59 +01:00
Daniel Marjamäki
a8ee4a03f0
Fixed #1456 (PATCH: Variable hides typedef with same name false positive)
2010-02-27 07:27:51 +01:00
Daniel Marjamäki
ce0131a1e6
Fixed #1397 (false positive: Memory leak in while loop)
2010-02-26 22:14:56 +01:00
Reijo Tomperi
9b6336013b
Fix #1455 (Preprocessor: Wrong line number in "No pair for character" error)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1455
2010-02-26 23:11:23 +02:00
Robert Reif
54bf67e766
Fixed #1456 (PATCH: Variable hides typedef with same name false positive)
2010-02-26 21:43:00 +01:00
Robert Reif
f4d600e93b
Fixed #1457 (PATCH: Variable hides enumerator with same name false negative)
2010-02-26 21:40:57 +01:00
Kimmo Varis
d064d38d35
Fix comment.
2010-02-26 13:21:27 +02:00
Daniel Marjamäki
377d3091a9
Fixed #1452 (Simplify goto better)
2010-02-25 20:03:39 +01:00
Robert Reif
0da133f8a0
Fixed #1451 (false positive: operator = should return reference to self)
2010-02-25 07:26:59 +01:00
Robert Reif
f9d444ed52
Fixed #1445 (segfault in Tokenizer::simplifyRedundantParanthesis())
2010-02-25 07:24:32 +01:00
Robert Reif
7d8adfb4df
Fixed #1449 (segmentation fault of cppcheck)
2010-02-24 17:50:02 +01:00
Robert Reif
d9df3d5c6e
Fixed #1434 (### Internal error in Cppcheck. Please report it.)
2010-02-23 22:12:55 +01:00
Daniel Marjamäki
4ef68546ef
Merge branch 'master' of git@github.com:danmar/cppcheck
2010-02-23 21:27:26 +01:00
Daniel Marjamäki
5254822bed
dmake: generate the lib/lib.pri file
2010-02-23 21:27:01 +01:00
Reijo Tomperi
edf76c77fa
Attempt to fix : #1425 : -I doesn't work properly in Windows
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1425
2010-02-23 21:28:40 +02:00
Daniel Marjamäki
8e58cfcd32
Removed cmake/scons files
2010-02-23 18:14:33 +01:00
Daniel Marjamäki
0b2ad2164f
Fixed #1442 (false positive: getting offset instead of dereferencing a null pointer)
2010-02-22 21:30:21 +01:00
Daniel Marjamäki
8f4edb5e45
Fixed #1409 (False positive: Buffer access out-of-bounds with strncpy and an array in typedef'ed struct)
2010-02-21 15:23:50 +01:00
Daniel Marjamäki
d5611a1a06
Fixed #1426 (false positive: returning LPVOID can be const)
2010-02-21 10:19:28 +01:00
Daniel Marjamäki
459a3bac50
Fixed #1396 (false positive: Resource leak)
2010-02-21 09:47:41 +01:00
Daniel Marjamäki
e4a685c6e9
Fixed #1430 (void foo(int nb))
2010-02-21 08:02:44 +01:00
Daniel Marjamäki
a25cdd63b6
Refactored the CheckOther::functionVariableUsage
2010-02-21 07:05:44 +01:00
Daniel Marjamäki
7a72932078
Tokenizer: simple simplification of array sizes
2010-02-20 18:13:09 +01:00
Daniel Marjamäki
e4cc8cf1a0
Fixed #1395 (false positive: Possible null pointer dereference)
2010-02-20 15:50:44 +01:00
Daniel Marjamäki
ccef1d6eb5
Fixed #1424 (false positive: unintialized variable)
2010-02-20 13:24:50 +01:00
Daniel Marjamäki
084b21494a
Fixed #1422 (false positive: uninitialized variable)
2010-02-20 11:43:53 +01:00
Daniel Marjamäki
a6c9a6fc54
Fixed #1407 (false positive memory leak when returning pointer to the allocated memory)
2010-02-20 10:17:45 +01:00
Daniel Marjamäki
d0348fa57a
Fixed #1403 (false positive: The function can be const)
2010-02-20 09:55:51 +01:00
Daniel Marjamäki
6a03fa604c
Fixed #1402 (false positive: uninitialized variable)
2010-02-20 09:35:57 +01:00
Robert Reif
24628013f1
Fixed #1427 (new check: check for typedef name hiding)
2010-02-20 09:07:29 +01:00
Daniel Marjamäki
57f63f65c2
Borland C++: Fixed compiler errors (operands must be same type)
2010-02-20 08:53:33 +01:00
Daniel Marjamäki
8411f449f8
Refactoring: Using string::compare instead of strncmp
2010-02-19 07:29:27 +01:00
Daniel Marjamäki
6b8cb08ec6
Refactoring CheckBufferOverrun. Use std::string instead of const char *
2010-02-18 22:25:29 +01:00
Daniel Marjamäki
375d2b1fcd
astyle formatting
2010-02-18 19:55:47 +01:00
Daniel Marjamäki
b59d79c303
readded checks for unused variables and unreachable code that were removed in 42c608b6f0
2010-02-18 18:45:13 +01:00
Robert Reif
5c6ec0364d
Fixed #1411 (### Internal error in Cppcheck. Please report it.)
2010-02-18 07:24:24 +01:00
Robert Reif
9e61e7dda8
Fixed #1405 (false positive: operator = should return reference t
2010-02-17 22:46:03 +01:00
Robert Reif
deb71fc566
Fixed #1405 (false positive: operator = should return reference to itself)
2010-02-17 22:42:08 +01:00
Daniel Marjamäki
db2c362604
Fixed #1389 (false positive: uninitialized variable)
2010-02-17 18:10:50 +01:00
Robert Reif
f15c408f13
Fixed #1388 (enum token/template parameter confusion - False positive)
2010-02-16 07:33:23 +01:00
Reijo Tomperi
e44f0b1b8d
Fix #1392 (Segfault in CheckBufferOverrun::checkScope)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1392
2010-02-15 23:20:09 +02:00
Monika Lukow
e9e5174797
Fixed #1333 (Detect access out of bounds 'for (i = 100; i > 0; --i) a[i] = 0;')
2010-02-14 23:10:15 +01:00
Reijo Tomperi
6643d39929
Remove unnecessary file open.
2010-02-14 21:55:21 +02:00
Reijo Tomperi
7f2871d353
astyle fix
2010-02-14 21:46:40 +02:00
Daniel Marjamäki
9394816fcf
Refactoring: Use std::string instead of const char *
2010-02-14 19:58:17 +01:00
Reijo Tomperi
ba00e031c0
Added %name% pattern to Token.
...
Currenly same as %var%, but in the future %var% is supposed to match only tokens that have varid != 0.
2010-02-12 23:40:05 +02:00
Reijo Tomperi
17b8d025a3
Fix operator= warning from our own code.
2010-02-12 22:38:17 +02:00
Reijo Tomperi
b52fa9451f
Fix #1385 (False positive: unsigned division)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1385
This also fixes a bug in setVarId(). "unsigned int a" didn't get varid,
untill later when unsigned was simplified away.
2010-02-12 22:24:06 +02:00
Daniel Marjamäki
669fe1b23d
Fixed #1382 (False positive: uninitialized variable when using assembly to initialize variable)
2010-02-12 18:15:15 +01:00
Reijo Tomperi
2a78637da7
Fix #1340 (False positive: Array out of bounds for re-initialised array pointer)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1340
2010-02-10 23:11:08 +02:00
Daniel Marjamäki
0a6aa0f094
Fixed #1376 (Member variable not initialized in the constructor false positive)
2010-02-10 19:28:51 +01:00
Reijo Tomperi
faced1b483
Possibly fix #1369 (Internal error - double-declared enum followed by another enum)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1369
Don't include same file twice if one is a/a.h and other is a/../a/a.h
2010-02-09 22:26:15 +02:00
Reijo Tomperi
45abd2d7fc
Fix #1366 (void Tokenizer::simplifyTemplates() --> Abort)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1366
2010-02-09 00:16:12 +02:00
Daniel Marjamäki
8853f304af
Fixed #1364 (False positive: (error) Possible null pointer dereference)
2010-02-08 18:25:08 +01:00
Daniel Marjamäki
19589adc1d
Fixed #1360 (false positive:: uninitialized class member of nested class inside a function)
2010-02-08 18:06:28 +01:00
Robert Reif
9591e09dd0
Fixed #1344 (false negative: missing const not found)
2010-02-08 07:25:19 +01:00
Monika Lukow
2d5d060514
Fixed #1094 (Improve check: unusual pointer arithmetic: 'ch+str')
2010-02-07 21:44:11 +01:00
Daniel Marjamäki
cd5b95849d
Fixed #1361 (### Internal error in Cppcheck. Please report it)
2010-02-07 15:00:19 +01:00
Daniel Marjamäki
fb09b2fd37
Fixed #1356 (Double-False positive: uninitialized variable)
2010-02-07 13:34:39 +01:00
Daniel Marjamäki
1b0c81a24b
Tokenizer: Fixed bug in setVarId. functions should never have a variable id
2010-02-07 13:04:33 +01:00
Daniel Marjamäki
ed8f3bc806
Fixed #1362 (Internal error when using ?-operator and nested {})
2010-02-07 09:14:59 +01:00
Daniel Marjamäki
93bb1c0174
astyle formatting
2010-02-06 23:51:29 +01:00
Daniel Marjamäki
e1b54df368
Fixed #1346 (False positive: Memory leak when allocated memory is stored elsewhere inside a condition)
2010-02-06 22:35:36 +01:00
Daniel Marjamäki
71117378ef
Fixed #1363 (false positive: memory leak)
2010-02-06 21:47:52 +01:00
Daniel Marjamäki
ebf36c1150
Fixed #824 (Exit code of cppcheck)
2010-02-06 19:47:08 +01:00
Daniel Marjamäki
bdfad4eb3f
fixed null pointer dereference when using --errorlist
2010-02-06 19:45:56 +01:00
Daniel Marjamäki
0a31e5e3ee
Fixed #1352 (false positive: uninitialized variable)
2010-02-06 16:51:32 +01:00
Daniel Marjamäki
70620b6f80
Borland C++: Fixed compiler error. When using 'a?b:c', Borland C++ requires that 'b' and 'c' has the same types
2010-02-06 10:39:16 +01:00
Robert Reif
b78845174d
Fixed #1355 (Fixed enum bug when expression contain comma)
2010-02-06 09:49:56 +01:00
Daniel Marjamäki
cbc853fdba
Partial fix for #322 (get configurations from headers that don't start at the beginning of the file)
2010-02-06 09:30:48 +01:00
Reijo Tomperi
9852ab86e9
Fix #1358 (False negative: out-of-bounds not found near return)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1358
2010-02-05 23:55:10 +02:00
Daniel Marjamäki
0d18050b55
Fixed #984 (improve output if strncpy is followed by strncat)
2010-02-05 17:35:18 +01:00
Robert Reif
6cbfc5f894
Fixed #1351 (add expression support to simplifyEnum)
2010-02-05 07:37:17 +01:00
Daniel Marjamäki
9e6ea07c14
CheckClass::noMemset: Refactoring so it handles more complex std template types
2010-02-04 21:49:58 +01:00
Daniel Marjamäki
da7e75f69e
Class checking: Minor refactoring when analysing memset on class
2010-02-04 20:53:04 +01:00
Daniel Marjamäki
9943262da0
Fixed #1287 (Use of memset on struct - std template types not handled)
2010-02-04 19:40:35 +01:00
Daniel Marjamäki
0ba665d77f
Fixed #1337 (Division by zero with __alignof__())
2010-02-03 21:23:44 +01:00
Daniel Marjamäki
d3b5889f88
Fixed #1345 (Not initialised variables warning missing in classes with dllexport)
2010-02-03 20:01:56 +01:00
Daniel Marjamäki
b01af012cd
Fixed #1342 (Superclass constructors in initializer lists are considered unused functions when superclass has a namespace.)
2010-02-03 18:37:48 +01:00
Robert Reif
f2eac901c0
Fixed #1343 (simplifyTypedef doesn't support deeply nested classes)
2010-02-03 07:58:36 +01:00
Daniel Marjamäki
4ec94116f5
Fixed #1341 (false positive 'uninitialized variable' when using Exception specifications)
2010-02-02 19:56:41 +01:00
Robert Reif
b704fc7bc7
Fixed #1339 (add nested struct support to simplifyEnum and simplifyTypedef)
2010-02-01 19:59:24 +01:00
Daniel Marjamäki
1b9afc82a4
Reverted 4f30468c80
. There was false positives such as #1335 so please fix them and then re-commit.
2010-02-01 19:46:51 +01:00
Robert Reif
64afcc8179
Fixed #1338 (simplify typedefs with global and nested namespace)
2010-01-31 21:46:18 +01:00
Daniel Marjamäki
1375a60e3f
Fixed #1004 (improve check: Unintialized variable not detected when using a reference (&))
2010-01-31 16:29:12 +01:00
Monika Lukow
25822dff24
Fixed #1249 (false positive '(error) Resource leak: f' for 'popen' / 'if(pclose(f) < 0)' sequence)
2010-01-31 11:44:30 +01:00
Monika Lukow
a0e96be0c3
Fixed #1274 (false positive: Dangerous usage of strncat)
2010-01-31 11:43:54 +01:00
Monika Lukow
4f30468c80
Fixed #1094 (Improve check: unusual pointer arithmetic: 'ch+str')
2010-01-31 11:42:02 +01:00
Daniel Marjamäki
1a59e1bc68
Tokenizer: remove redundant assignments and variables
2010-01-31 09:52:19 +01:00
Daniel Marjamäki
e15a16eb15
Tokenizer: Remove redundant assignments and variables
2010-01-31 09:33:57 +01:00
Daniel Marjamäki
e1efad0c27
Tokenizer: remove the keyword 'inline'
2010-01-31 08:11:29 +01:00
Robert Reif
d17d199415
Tokenizer: fix for multiple array definitions for a single typedef
2010-01-31 07:16:19 +01:00
Robert Reif
630d9ba552
Fixed #1326 (remove simplified enum definitions)
2010-01-31 07:13:09 +01:00
Robert Reif
7cbdb9f8a1
Fixed #1331 (simplify typedef of complex arrays)
2010-01-30 19:41:22 +01:00
Daniel Marjamäki
48f3921c36
Null pointer dereference: sending to output stream
2010-01-30 14:40:33 +01:00
Daniel Marjamäki
8716c771a4
Tokenizer: improved the simplifyInitVar
2010-01-30 14:25:11 +01:00
Daniel Marjamäki
3b08712930
Fixed #1005 (improve check: nullpointer dereference not found when it is initialized with NULL-cast)
2010-01-30 09:33:16 +01:00
Robert Reif
882e2225e0
Fixed 1329 (simplify typedef of function pointer returning template)
2010-01-30 08:00:11 +01:00
Daniel Marjamäki
f9d5fb3191
Fixed #1327 (False positive: Redundant code: Found a statement that begins with numeric constant)
2010-01-29 22:28:49 +01:00
Reijo Tomperi
6e48f57826
Remove debug print
2010-01-29 23:24:16 +02:00
Reijo Tomperi
1d5ba4e320
Improved updateClassList(), but not yet took it into use.
...
findClassFunction is now non-static.
updateClassList usage is currently commented out as it doesn't handle class inside a function
2010-01-29 23:22:18 +02:00
Daniel Marjamäki
f561441d90
Fixed #1319 (false negative: missing const not found)
2010-01-29 19:38:56 +01:00
Daniel Marjamäki
53f514fc5c
Tokenizer: Fixed const simplification
2010-01-29 19:34:43 +01:00
Robert Reif
94c5d92b2b
Fixed #1323 (segfault with style in CheckClass::operatorEqRetRefThis())
2010-01-29 16:04:27 +01:00
Robert Reif
19bb2940cc
Fixed #1325 (Segmentation fault in simplifyTypedef due to bad preprocessing)
2010-01-29 16:00:48 +01:00
Robert Reif
fc54ed1eef
Fixed #1326 (remove simplified enum definitions)
2010-01-29 15:57:26 +01:00
Daniel Marjamäki
9d11492845
Fixed #1286 (Memory leak not detected)
2010-01-27 22:05:04 +01:00
Daniel Marjamäki
15b4abd6d3
killerbot: Fixed #1314 (specify the files to check in 1 input file)
2010-01-27 21:43:01 +01:00
Daniel Marjamäki
e49f7bfa0e
Fixed #1315 (mismatched allocation and deallocaton not detected)
2010-01-27 21:02:13 +01:00
Daniel Marjamäki
7ec27cb43b
updated --doc output about new checks in 1.40
2010-01-27 19:25:48 +01:00
Daniel Marjamäki
1c84dc814c
Auto variables: Improved handling of temporaries
2010-01-27 19:16:32 +01:00
Robert Reif
45b6b9e5a1
Fixed #1316 (### Internal error in Cppcheck. Please report it.)
2010-01-27 19:03:24 +01:00
Daniel Marjamäki
32fcb8fe18
Auto variables: returning pointer to temporary .c_str() data
2010-01-26 22:11:34 +01:00
Daniel Marjamäki
fa305d70bc
Fixed #1302 (False positive: Confusion between POSIX open() and class member)
2010-01-26 20:10:52 +01:00
Daniel Marjamäki
db0466eb19
Fixed #1278 (Confusing style message formatting)
2010-01-26 19:37:22 +01:00
Daniel Marjamäki
e12d115e9a
Fixed #1312 (false positive: missing const message on functions returning references)
2010-01-25 21:40:57 +01:00
Robert Reif
8be8c266ac
Fixed #1313 (unnamed enums not simplified properly)
2010-01-25 07:45:16 +01:00
Robert Reif
989e8393e4
Fixed #1307 (Internal error with typedef in parameter list)
2010-01-24 22:40:35 +01:00
Daniel Marjamäki
724c55b32a
Memory leaks: some refactorings and minor improvements
2010-01-24 21:48:39 +01:00
Daniel Marjamäki
65881b9346
Fixed #1238 (False Negative : memory leak with template class)
2010-01-24 20:04:09 +01:00
Daniel Marjamäki
6d9740adea
Tokenizer: Fixed Tokenizer::simplifyKnownVariable bug when the variable is re-assigned in a loop
2010-01-24 19:27:39 +01:00
Daniel Marjamäki
7ce4825f95
Fixed #1308 (False positive: The function 'x' can be const for a static member function)
2010-01-24 18:26:39 +01:00
Daniel Marjamäki
25ba399a50
const class functions: refactorings
2010-01-24 13:45:56 +01:00
Daniel Marjamäki
b4b97e5706
const: fixed false positive when using increment/decrement
2010-01-24 13:33:30 +01:00
Reijo Tomperi
24052c16b4
Fix some style errors found from our own code.
2010-01-23 23:44:08 +02:00
Daniel Marjamäki
a0d8f44603
CheckClass: The operator< etc member functions can often be const
2010-01-23 22:36:04 +01:00
Reijo Tomperi
7817d5b142
Fix #1279 (Change error message: Invalid number of character ({). Can't process file.)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1279
2010-01-23 23:18:11 +02:00
Daniel Marjamäki
4d7ac2f82e
STL: fixed false positive when using erase
2010-01-23 22:03:38 +01:00
Daniel Marjamäki
43c8fe895c
Fixed #1301 (False positive: Data is allocated but not initialized)
2010-01-23 21:25:17 +01:00
Daniel Marjamäki
aab05524e5
Fixed #1305 (False positive: The function 'x' can be const when indirectly calling a non-const member)
2010-01-23 21:08:40 +01:00
Daniel Marjamäki
9a6b450501
Fixed #1304 (False positive: The function 'x' can be const when modifing a member)
2010-01-23 20:59:20 +01:00
Daniel Marjamäki
5b76be4935
Fixed #1303 (False positive: The function 'x' can be const for a constructor)
2010-01-23 20:47:29 +01:00
Daniel Marjamäki
f62466493b
New Check: Detect return of invalid reference
2010-01-23 20:39:12 +01:00
Daniel Marjamäki
fb10396cb3
only run CheckClass::checkConst if style checking is on
2010-01-23 09:38:35 +01:00
Daniel Marjamäki
35c303943f
Partial fix for #13 - detect simple cases of member functions that can be const
2010-01-23 09:19:22 +01:00
Daniel Marjamäki
037ecffc34
detect when function pointer that is null is used
2010-01-23 09:15:30 +01:00
Daniel Marjamäki
7b986c831d
Report when using uninitialized function pointer
2010-01-23 07:57:57 +01:00
Daniel Marjamäki
8a9eba980b
Function pointers: re-enabled the simplifyFunctionPointers
2010-01-23 07:43:12 +01:00
Robert Reif
13ca2510cc
Fixed #1298 ((error) ### Internal error in Cppcheck. Please report it. (typedef in fun proto))
2010-01-22 20:26:07 +01:00
Daniel Marjamäki
1552c0f7f2
Fixed #1276 (False Uninitialized variable when using goto)
2010-01-22 20:20:43 +01:00
Daniel Marjamäki
e9c8e1d8b1
doxygen and minor refactorings
2010-01-22 19:29:24 +01:00
Daniel Marjamäki
59de7934b7
Fixed #643 (Member variable not initialized not detected if any unknown function called)
2010-01-22 18:51:25 +01:00
Robert Reif
9f853cb164
Fixed #1297 (typedef causes internal error in vlc/modules/access/imem.c)
2010-01-22 17:27:40 +01:00
Daniel Marjamäki
d4b13eee9f
Fixed #1290 (1.40: Internal error)
2010-01-21 20:05:32 +01:00
Daniel Marjamäki
2e707974d0
Fixed #1273 (scope of variable limited not detected in latest versions)
2010-01-21 18:50:56 +01:00
Robert Reif
9f0b9551cf
This patch simplifies the function pointer return type code and allows more complex return types.
2010-01-21 18:01:09 +01:00
Robert Reif
e9e64033e7
Improved typedef simplification of function pointers
2010-01-21 07:51:08 +01:00
Daniel Marjamäki
a6e81c2ee7
Fixed #1293 (Things to add to call_func_white_list)
2010-01-20 22:03:06 +01:00
Daniel Marjamäki
3447030564
Merge branch 'master' of git@github.com:danmar/cppcheck
2010-01-20 21:19:32 +01:00
Daniel Marjamäki
96359b14ff
Simplify function pointers
2010-01-20 21:19:06 +01:00
Robert Reif
e163f878ab
Handle/simplify function pointer typedefs
2010-01-20 21:16:40 +01:00
Reijo Tomperi
b83d257852
Fix #1296 (false positive: index out of bounds)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1296
2010-01-20 21:26:54 +02:00
Daniel Marjamäki
85fcd4c9a9
Fixed #1282 (False positive for a memory leak in a simple loop)
2010-01-19 19:08:03 +01:00
Daniel Marjamäki
f49cc7f0ff
CheckMemoryLeak: Added 'scanf' and 'sscanf' to the whitelist
2010-01-18 21:58:27 +01:00
Daniel Marjamäki
32604dd55e
Fixed #1266 ('qsort' missing in call_func_white_list)
2010-01-18 21:34:11 +01:00
Daniel Marjamäki
53d036fadf
Added Cppcheck::terminate function that will terminate the checking ASAP
2010-01-18 20:23:50 +01:00
Robert Reif
cd31cd9298
Fixed #1251 (tokenize typedef of reference)
2010-01-18 19:06:50 +01:00
Daniel Marjamäki
fbf428550a
Fixed #1262 (cppcheck false positives: 'Possible null pointer dereference', 'Uninitialized variable')
2010-01-17 19:08:45 +01:00
Daniel Marjamäki
f3e25a5244
Fixed doxygen error messages
2010-01-17 16:38:28 +01:00
Daniel Marjamäki
25bf50755e
Reformatting the --doc output to work better in the wiki
2010-01-17 14:56:56 +01:00
Daniel Marjamäki
5595a17e41
Updated version to 1.40
2010-01-17 13:52:28 +01:00
Robert Reif
70dbb8ba17
Fixed #1275 (Cppcheck hangs when analysing the code 'typedef struct { } A, *B, **C;')
2010-01-17 08:16:17 +01:00
Daniel Marjamäki
fbefb8df34
Fixed #1272 (links in typedef not handled correctly)
2010-01-16 19:42:37 +01:00
Daniel Marjamäki
0a8ca1f160
Fixed #1271 (SIGSEGV on malformed source (macro stub + fundef))
2010-01-16 13:56:57 +01:00
Robert Reif
a0caea4ee6
Refactoring the handling of typedefs
2010-01-16 09:18:21 +01:00
Daniel Marjamäki
81ca6e9f98
Revert "minor tweak in Borland C++ project file"
...
This reverts commit ad06ee4f71
.
2010-01-16 08:47:46 +01:00
Daniel Marjamäki
ad06ee4f71
minor tweak in Borland C++ project file
2010-01-16 08:17:40 +01:00
Reijo Tomperi
d37864f8c4
Fix part of #1262 (cppcheck false positives: 'Possible null pointer dereference'
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1262
2010-01-15 23:46:47 +02:00
Daniel Marjamäki
f591d8f8e1
refactoring
2010-01-14 22:04:58 +01:00
Daniel Marjamäki
7059dd5693
astyle formatting
2010-01-14 22:01:59 +01:00
Daniel Marjamäki
b9f09679c7
lanurmi: Fixed #1269 (Changes required for compiling with Sun's compiler)
2010-01-14 22:00:14 +01:00
Daniel Marjamäki
ac077d3160
Fixed #1264 (False positive: Resource leak with if-else in while)
2010-01-14 21:41:50 +01:00
Daniel Marjamäki
a7bddc8fd3
Fixed #1268 (Null pointer dereference false positive)
2010-01-14 20:02:38 +01:00
Daniel Marjamäki
bc5800004b
wrote comments about the preprocessor
2010-01-13 21:50:44 +01:00
Daniel Marjamäki
cefa695dba
Fixed #1265 ((error) Uninitialized variable on macro expansion)
2010-01-13 19:37:55 +01:00
Robert Reif
0212225859
Tokenizer: fixed typedef issues
2010-01-13 07:59:47 +01:00
Daniel Marjamäki
1aac8f3e52
Uninitialized variables: disable subfunction analysis if multiple threads are used
2010-01-12 22:33:47 +01:00
Daniel Marjamäki
0638bc2112
CheckMemoryLeaks: Added 'strlen' to white list
2010-01-12 22:10:59 +01:00
Daniel Marjamäki
fd5e3e63b8
Fixed #1258 ('fscanf' missing in call_func_white_list)
2010-01-12 21:56:22 +01:00
Daniel Marjamäki
2de49129dc
Fixed #1259 (false postive: Member variable 'A::b' is not assigned a value in 'A::operator=')
2010-01-12 21:36:40 +01:00
Daniel Marjamäki
2358c51694
Tokenizer: some cleanup of std::
2010-01-12 21:25:31 +01:00
Daniel Marjamäki
374def4a53
Fixed #1070 (Improve scope error message)
2010-01-12 19:34:33 +01:00
Daniel Marjamäki
814eb6caee
Fixed #1257 (potential leaks not reported becauseof 'continue' in loop)
2010-01-12 19:12:08 +01:00
Robert Reif
5e8e4fd3e9
Fixed #1252 (Internal error in Cppcheck while parsing struct)
2010-01-12 17:38:36 +01:00
Robert Reif
7b6bf80057
Fixed #1250 (tokenize typedef of union)
2010-01-11 22:58:57 +01:00
Daniel Marjamäki
d3b7f5931f
Fixed #1174 (improve check: Unintialized variable not detected in subfunction)
2010-01-11 22:28:07 +01:00
Daniel Marjamäki
c666a9662b
BufferOverrun: negative index is out of bounds
2010-01-11 21:18:07 +01:00
Daniel Marjamäki
b8b6b0ec32
Uninitialized variables: fixed false positives when using pointer aliasing
2010-01-11 19:25:01 +01:00
Robert Reif
94d5e32aa1
Fixed #1248 (tokenize typedef of array)
2010-01-11 17:09:04 +01:00
Daniel Marjamäki
8be54b592d
ExecutionPath: better handling of for/while/do/switch, it doesn't bail out everything
2010-01-10 22:05:51 +01:00
Daniel Marjamäki
c5966bba59
Fixed #1225 (false negative :: uninitialized variable not detected when using enums)
2010-01-10 20:36:15 +01:00
Daniel Marjamäki
3fb420cbf0
fixed unlogged errors from the tokenizer and also some errors reported by valgrind
2010-01-10 20:03:46 +01:00
Daniel Marjamäki
a50ec2eded
memory leaks: better handling of loops and switch
2010-01-10 15:40:50 +01:00
Daniel Marjamäki
f65bf6d565
Fixed #1220 (False memory leak when using while)
2010-01-10 14:00:32 +01:00
Daniel Marjamäki
3fabe53570
Memory leaks: Better handling of switch
2010-01-10 10:37:54 +01:00
Daniel Marjamäki
b82cb2e41e
Fixed #1218 (Improve check: incrementing uninitialized variable i++)
2010-01-10 09:09:37 +01:00
Robert Reif
19ba151531
Fixed #1244 (tokenize typedef of unnamed struct)
2010-01-10 08:49:02 +01:00
Daniel Marjamäki
4c641ed80c
Fixed #1189 (false negative: using uninitialized variable i 'a[i] = 0;')
2010-01-09 22:26:05 +01:00
Daniel Marjamäki
0908728601
Fixed #1231 (Preprocessor: Fail to evaluate '#if ! defined _ABCD_')
2010-01-09 21:54:20 +01:00
Daniel Marjamäki
6ec5b797ab
Borland C++: Fixed compiler error
2010-01-09 10:24:35 +01:00
Daniel Marjamäki
2dd0907146
fixed segmentation fault
2010-01-08 21:54:24 +01:00
Daniel Marjamäki
ca74f57fd0
Fixed #1237 (Uninitialized variable false positive for return-value pattern in pan source code.)
2010-01-08 21:24:48 +01:00
Robert Reif
60ef3ef872
Fixed #1233 (false positive: operator = should check for assignment to self)
2010-01-08 19:15:24 +01:00
Daniel Marjamäki
686137415f
Fixed #1235 (CheckMemoryLeakInFunction: Wrong handling of 'fcloseall')
2010-01-07 21:36:51 +01:00
Robert Reif
b30b07beee
Fixed #1232 (segmentation fault of cppcheck when scanning templates)
2010-01-07 18:09:35 +01:00
Daniel Marjamäki
b366dba682
After suggestion from Jim Vollner, remove dead pointers from the used list
2010-01-06 21:29:39 +01:00
Daniel Marjamäki
94b0cbbcff
uncomment validation of Tokenizer::_tokensBack
2010-01-06 21:18:42 +01:00
Daniel Marjamäki
57d1da3910
Ticket #1228 : Handle tokensBack in the Token class. When adding&removing tokens the Token class can make sure that this pointer is updated accordingly. It is very important that the tokensBack has the same scope as the token list, otherwise there will be a dead pointer problem.
2010-01-06 20:19:27 +01:00
Daniel Marjamäki
485f3c7708
Fixed #1221 ([False positive] Member variable not initialized with operator[] gives wrong result)
2010-01-06 19:04:15 +01:00
Reijo Tomperi
ff0573998a
Added more validating code to tokenizer. Currently commented out.
2010-01-06 01:32:05 +02:00
Robert Reif
e6cc897e29
Fixed #1224 (segmentation fault of cppcheck)
2010-01-05 21:55:33 +01:00
Robert Reif
13f627d0d5
Fixed #1215 (are enums processed properly?)
2010-01-04 17:22:06 +01:00
Kimmo Varis
488ea55358
CMake - add header files to lib project (and to VS project).
2010-01-03 21:08:49 +02:00
Daniel Marjamäki
e248f7d3e5
Fixed #1023 (improve check: Unintialized variable not detected when using +=)
2010-01-03 18:49:13 +01:00
Daniel Marjamäki
e286896d75
Fixed #1216 (false positive: uninitialized variable when using exit|abort)
2010-01-03 15:35:32 +01:00
Daniel Marjamäki
fa535ff3ae
Fixed #440 (NULL referencing not detected)
2010-01-03 13:30:20 +01:00
Robert Reif
2a546dc9c0
Fixed #1184 (improve test: operator =)
2010-01-03 08:26:02 +01:00
Daniel Marjamäki
1032eb2449
Fixed #1214 (false positive: uninitialized variable 'bool fixed = std::ios_base::fixed;')
2010-01-03 08:03:28 +01:00
Daniel Marjamäki
38b480a4b5
Fixed #1203 (Preprocessor: Doesn't handle macros usage that contain ';')
2010-01-02 20:54:52 +01:00
Daniel Marjamäki
d82079e86f
Fixed #1209 (False positive: uninitialized variable c when it is initialized with 'ab(sizeof(xyz), &c)')
2010-01-02 18:16:44 +01:00
Robert Reif
bcafb30d0d
Fixed #1211 (add struct support for constructor checks)
2010-01-02 17:29:55 +01:00
Daniel Marjamäki
2e62a3f4c7
Fixed #1202 (false positive: uninitialized variable when using 'do')
2010-01-02 09:08:36 +01:00
Daniel Marjamäki
6af5e434d8
Fixed #1204 (Tokenizer::findClassFunction broken)
2010-01-02 08:33:54 +01:00
Slava Semushin
82ae064218
Fixed #1013 (autovariables: detect when assigning parameter **par)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1013
2010-01-02 03:53:34 +06:00
Slava Semushin
b816968f28
Fixed #1197 (Segmentation fault when we define function which was already defined by preprocessor)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1197
2010-01-02 03:25:37 +06:00
Daniel Marjamäki
ddfd0b948e
Fixed #1178 (1.39: Internal error)
2010-01-01 21:06:30 +01:00
Daniel Marjamäki
071b7b463d
Fixed #1200 (false positive 'uninitialized variable' when using throw)
2010-01-01 20:12:39 +01:00
Daniel Marjamäki
b0d7623dcf
refactoring the fix for #1191
2010-01-01 19:49:33 +01:00
Daniel Marjamäki
f8bd59f5b5
Fixed #1191 (false positive: uninitialized variable)
2010-01-01 19:43:02 +01:00
Daniel Marjamäki
77c5b793c9
Fixed #1196 (Hang: Cppcheck hang for the file linux-2.6/drivers/crypto/hifn_795x.c)
2010-01-01 13:26:54 +01:00
Daniel Marjamäki
7ecd333ffa
Fixed #1188 (false negative: dereferencing p, which is a null pointer 'int y = 5 + *p')
2009-12-31 20:00:20 +01:00
Daniel Marjamäki
e0ecef5d71
fixed a hang in Tokenizer::simplifyFunctionParameters
2009-12-31 19:31:21 +01:00
Robert Reif
12641e2d76
Fixed #1184 (improve test: operator =)
2009-12-31 13:44:03 +01:00
Daniel Marjamäki
f797794601
fixed cppcheck warning
2009-12-31 13:34:43 +01:00
Daniel Marjamäki
ee1675270b
Fixed #1181 (Preprocessor fails while expanding macros)
2009-12-31 12:45:17 +01:00
Daniel Marjamäki
0159287437
Fixed #1183 (False positive: uninitialized variable p 'd = bar(sizeof(*p));')
2009-12-31 09:10:20 +01:00
Daniel Marjamäki
0ee3d7e46a
Fixed #1182 (False positive: uninitialized variable 'int *pa = &a;')
2009-12-30 21:42:15 +01:00
Daniel Marjamäki
6c0919d9bd
Fixed #1173 (Improve check: memory leak not detected in constructor)
2009-12-30 21:29:54 +01:00
Robert Reif
f8f0a31e41
Fixed #1167 (### Internal error in Cppcheck. Please report it.)
2009-12-30 20:56:16 +01:00
Daniel Marjamäki
71a83647c6
cleanup
2009-12-30 20:38:16 +01:00
Daniel Marjamäki
ae3ff7d376
Fixed #1087 (uninitialized data not detected 'char z = *str')
2009-12-30 20:37:11 +01:00
Daniel Marjamäki
461d826eff
Fixed #1105 (improve check: uninitialized variable not detected for 'a = a')
2009-12-30 20:15:44 +01:00
Robert Reif
3a46ef0487
Fixed #1176 (void operator = check doesn't support struct)
2009-12-30 18:40:02 +01:00
Daniel Marjamäki
d83131ca92
Fixed #1041 (passing a nullpointer to a reference)
2009-12-30 17:42:41 +01:00
Daniel Marjamäki
a7ab47bb98
Fixed #1067 (Tokenizer: K&R style function that returns function pointer)
2009-12-30 15:12:38 +01:00
Daniel Marjamäki
06ee643c6a
Fixed #1177 (False positive: pointer is not dereferenced 'sizeof(*p)')
2009-12-30 11:32:46 +01:00
Daniel Marjamäki
2de2ecafe4
Fixed #1168 (false positive: Uninitialized variable)
2009-12-30 08:24:27 +01:00
Daniel Marjamäki
2a28ca72cc
Fixed #1166 (improve check: using uninitialized pointer to create reference 'int &r(*p);')
2009-12-29 20:36:20 +01:00
Daniel Marjamäki
71b328d703
Robert Reif: Fixed #1163 (post increment test broken for complex template types)
2009-12-29 19:24:48 +01:00
Daniel Marjamäki
160f795710
Fixed #1165 (Tokenizer: wrong simplification of 'do { .. } while (0)' if the body contains continue or break)
2009-12-29 12:15:39 +01:00
Daniel Marjamäki
4cbae159b2
ExecutionPath: Refactoring. Removed the bailOut variable
2009-12-29 09:30:02 +01:00
Daniel Marjamäki
cfdf2b8cfe
Fixed #1160 (Null pointer dereference vs. goto)
2009-12-29 09:17:07 +01:00
Daniel Marjamäki
58e85d55e3
astyle formatting
2009-12-29 07:50:33 +01:00
Daniel Marjamäki
905533552d
Robert Reif: Fixed #1164 (only first void operator = found)
2009-12-29 07:48:37 +01:00
Daniel Marjamäki
84ce6ba75a
Robert Reif: Fixed #1162 (add support to tokenize typedefs with templates)
2009-12-29 07:28:00 +01:00
Daniel Marjamäki
d3d3ad101f
Valgrind: Fixed memory leaks when running testrunner that was found by Valgrind
2009-12-28 19:48:30 +01:00
Daniel Marjamäki
61e61c1584
Robert Reif: Fixed #1158 ((possible style) message with regular check)
2009-12-28 18:06:26 +01:00
Daniel Marjamäki
28f2bf2150
Robert Reif: Fixed #1161 (add tokenize support for typedefs with enum definitions)
2009-12-28 17:57:52 +01:00
Daniel Marjamäki
6a31fe6403
Fixed #1159 (Valgrind gives error in Tokenizer::simplifyWhile0)
2009-12-28 16:32:34 +01:00
Daniel Marjamäki
9aca2e7680
Fixed #1156 ([False positive] Uninitialized variable - class member in constructor)
2009-12-28 12:51:28 +01:00
Daniel Marjamäki
6fd74dce47
exitcode suppressions. Partly fixes #1113
2009-12-28 11:26:52 +01:00
Daniel Marjamäki
197bcf17ba
Tokenizer: Simplify 'while (0)' better
2009-12-28 08:37:34 +01:00
Daniel Marjamäki
b1e963fe2c
Fixed another issue with #1154 (false positive: Data is allocated but not initialized)
2009-12-27 18:00:43 +01:00
Daniel Marjamäki
24c5f4d53c
astyle formatting
2009-12-27 17:46:24 +01:00
Daniel Marjamäki
1c0f3ee179
Fixed #1154 (false positive: Data is allocated but not initialized)
2009-12-27 17:35:18 +01:00
Daniel Marjamäki
738987a686
Fixed #1138 (improve check: dereferencing uninitialized pointer)
2009-12-27 17:20:34 +01:00
Martin Ettl
c3886a5803
added further testcases to testmathlib::convert(); now the conversion of +-[hexnumber|octalnumber] works correctly
2009-12-27 15:18:18 +01:00
Martin Ettl
c2b3cfccc9
extended testcases of mathlib; fixed zero conversion: +0 and -0 is converted to 0
2009-12-27 14:30:23 +01:00
Daniel Marjamäki
c7cede1d76
Fixed #972 (New check: return pointer of stack memory)
2009-12-27 13:08:41 +01:00
Daniel Marjamäki
dccba65502
Uninitialized variables: Refactoring and commenting a little
2009-12-27 10:48:44 +01:00
Daniel Marjamäki
fbfe5a4bd1
Fixed #1153 (False positive: uninitialized data for reinterpret_cast)
2009-12-27 09:27:05 +01:00
Daniel Marjamäki
ab7ffd2391
Uninitialized variables: Fixed false positive for 'if (ptr)'
2009-12-26 16:22:14 +01:00
Daniel Marjamäki
a82a085d10
Fixed #1151 (false positive: Data is allocated but not initialized)
2009-12-26 09:30:02 +01:00
Daniel Marjamäki
ad8184f060
Fixed #1152 (Hang/Slow: ExecutionPath handling hangs)
2009-12-26 08:37:59 +01:00
Daniel Marjamäki
9819b75e17
ExecutionPath: Refactoring if-handling
2009-12-25 20:50:23 +01:00
Daniel Marjamäki
7bf0622ae0
ExecutionPath: Refactoring the interface
2009-12-25 20:12:06 +01:00
Daniel Marjamäki
b5291825ce
Fixed #683 (wrong usage of strcmp)
2009-12-25 19:45:21 +01:00
Daniel Marjamäki
5925b88b38
Robert Reif: improve check: array index out of bounds, show name of array, array size and array index
2009-12-25 15:25:58 +01:00
Daniel Marjamäki
1a25e40180
Robert Reif: fix cppcheck post increment warning
2009-12-25 15:19:36 +01:00
Daniel Marjamäki
44a629ec74
Fixed #1141 (Tokenizer: Wrong simplification of calculations)
2009-12-25 14:47:15 +01:00
Daniel Marjamäki
9b05850e97
fixed unit testing
2009-12-23 20:00:12 +01:00
Daniel Marjamäki
ea51c3e098
Refactoring the uninitialized variable / null pointer checks so they use a common function to inspect function calls
2009-12-23 19:51:32 +01:00
Daniel Marjamäki
a7d48f2eb4
Fixed #1147 (Improve check: return uninitialized variable)
2009-12-23 17:55:03 +01:00
Daniel Marjamäki
b6c320de8a
Fixed false positives about uninitialized variables
2009-12-23 15:01:23 +01:00
Daniel Marjamäki
ef21ba7425
Fixed #1137 (false positive: uninitialized variable when using a class object)
2009-12-23 13:57:01 +01:00
Daniel Marjamäki
5a89cc3259
Robert Reif: Fixed #1139 (false negative: CheckOther::postIncrement() only finds at most one problem)
2009-12-23 13:38:54 +01:00
Daniel Marjamäki
4419f4a342
Robert Reif: fix a style warning
2009-12-23 12:16:02 +01:00
Daniel Marjamäki
d2dc5806cd
Borland C++: Fixed compiler error
2009-12-22 23:21:52 +01:00
Daniel Marjamäki
305ef25208
Visual Studio: Added casts to silence compiler warnings
2009-12-22 22:44:21 +01:00
Daniel Marjamäki
cd2e501794
Visual Studio: Fixed unittests
2009-12-22 21:56:00 +01:00
Daniel Marjamäki
2bd60ab6c8
Fixed #1133 (Uninitialized array: strchr, strrchr, etc)
2009-12-22 21:08:29 +01:00
Daniel Marjamäki
566cfce8da
Fixed #1128 (false positive: Data is allocated but not initialized)
2009-12-22 21:00:52 +01:00
Daniel Marjamäki
c05aebbc0a
Fixed #1112 (cppcheck fails because of accented characters in comments)
2009-12-22 20:38:12 +01:00
Daniel Marjamäki
4dac46b2d7
Fixed #1127 (Segfault with template)
2009-12-22 20:10:08 +01:00
Daniel Marjamäki
11da89784f
Eric Sesterhenn: Fixed #1130 (False positive uninitialized variable)
2009-12-22 19:16:34 +01:00
Daniel Marjamäki
b4b63789fc
Eric Sesterhenn: Fixed #1131 (descriptor leak false positive)
2009-12-22 19:13:46 +01:00
Daniel Marjamäki
5b87a51aa5
Robert Reif: Fixed #1108 (Only trivial typedefs are tokenized properly)
2009-12-22 19:10:33 +01:00
Daniel Marjamäki
2e0566bf7a
Fixed #1096 (Non-obvious error message: Overlapping data buffer)
2009-12-21 21:05:55 +01:00
Daniel Marjamäki
72bf1c1dbe
Fixed #1095 (Non-obvious error message: Dangerous usage of erase)
2009-12-21 20:49:16 +01:00
Daniel Marjamäki
f5f8d857c1
preprocessor: removed unnecessary casts
2009-12-21 20:26:57 +01:00
Daniel Marjamäki
83d5a72659
Fixed #1126 (False positive: upon exception there is memory leak (calling unknown function))
2009-12-21 20:04:55 +01:00
Daniel Marjamäki
b3b07321ca
ericsesterhenn: Fixed #1091 (improve check: nullpointer dereference not detected)
2009-12-21 19:09:13 +01:00
Daniel Marjamäki
763e3d9eb5
Execution Path: Refactoring
2009-12-21 18:17:35 +01:00
Reijo Tomperi
df0d2ca83c
Fix #1124 (Invalid number of character ((). Can't process file.)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1124
2009-12-20 23:50:57 +02:00
Daniel Marjamäki
11c7b8a839
Execution Path: some refactorings of the checking
2009-12-20 19:44:32 +01:00
Daniel Marjamäki
d9cf70c1c6
Fixed #1119 (false positve: uninitialized variable y when y is assigned in inner expression 'x = (y = 10)')
2009-12-20 13:55:17 +01:00
Daniel Marjamäki
191a913ff9
Fixed #1117 (segmentation fault of cppcheck)
2009-12-20 12:45:34 +01:00
Kimmo Varis
9e2a42ebf9
CMake - use more strict compiler flags.
2009-12-20 10:45:57 +02:00
Daniel Marjamäki
d86234b7fd
Preprocessor: Use 'unsigned char' instead of 'char'
2009-12-20 09:35:51 +01:00
Daniel Marjamäki
74b9bccd07
code cleanup
2009-12-20 09:02:25 +01:00
Daniel Marjamäki
813c674611
stl size: minor fix to prevent segmentation fault when token is null
2009-12-19 19:27:12 +01:00
Daniel Marjamäki
ad225ea745
stl size: added documentation
2009-12-19 19:24:48 +01:00
Daniel Marjamäki
e7c0e4d482
Fixed #1093 (False positive: missing constructor)
2009-12-19 17:58:52 +01:00
Daniel Marjamäki
8a1940e043
astyle
2009-12-19 17:57:58 +01:00
Daniel Marjamäki
95f652a2b4
robert reif: Fixed #1118 (new check: use empty() instead of checking size() against zero)
2009-12-19 15:24:59 +01:00
Daniel Marjamäki
69a98d81fc
Fixed #1107 (False positive: Dangerous usage of erase, when using std::list)
2009-12-18 20:55:51 +01:00
Daniel Marjamäki
8665b36f54
lanurmi: Fixed #1016 (Patch: Refactor #ifdefs in filelister.cpp)
2009-12-18 18:52:09 +01:00
Daniel Marjamäki
d4adab3e78
added error info about the strncpy check
2009-12-18 17:33:33 +01:00
Daniel Marjamäki
0da0b5ffed
ericsesterhenn: Fixed #1106 (check if buffer is zero terminated after a strncpy)
2009-12-18 17:26:15 +01:00
Kimmo Varis
b619538aa3
CMake - add missing file in lib.
2009-12-17 20:19:55 +02:00
Kimmo Varis
a669ef0ed4
CMake - reorder files in lib's makefile.
2009-12-17 20:16:28 +02:00
Kimmo Varis
c85c0fbabc
Add simple CMake build files to build lib and cli.
...
Apparently not everybody wants to use QMake to build cppcheck. Which is
understandable if you only want to hack on/build lib and cli. Qt and QMake are
pretty lot to install for just that.
So lets start using CMake. It is widely used and is "just" build system and not
programming framework. CMake is also easy to use for building Qt software too
so it can replace QMake.
This first commit only builds lib and cli for Linux.
2009-12-15 22:27:17 +02:00
Daniel Marjamäki
1680d1fb42
Fixed #1086 (segmentation fault of cppcheck '#if define(A)+define(B)+define(C)!=1')
2009-12-15 20:18:32 +01:00
Daniel Marjamäki
e03ff727d4
Fixed #1103 (false positive: uninitialized variable when using references)
2009-12-15 19:50:48 +01:00
Daniel Marjamäki
368df4c083
TestLocalLeaks: going out of scope
2009-12-15 19:27:07 +01:00
Reijo Tomperi
64261e6909
Fix compiler error: cast from 'CheckLocalLeaks*' to 'int' loses precision
2009-12-15 00:57:32 +02:00
Daniel Marjamäki
9cb6102983
fixed #1099 (GUI: unable to build gui from current git-head)
2009-12-14 23:22:27 +01:00
Reijo Tomperi
30f789a168
Fix #1076 (Invalid number of character ({). Can't process file.)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1076
2009-12-15 00:06:05 +02:00
Daniel Marjamäki
0c13f9ba5c
Added TestLocalLeaks
2009-12-14 20:30:31 +01:00
Daniel Marjamäki
4dc8794c69
Fixed #1082 (False positive: Resource leak in loop which exits only after releasing resource)
2009-12-13 19:50:49 +01:00
Daniel Marjamäki
829a4f8453
Fixed #1084 (define configuration lost)
2009-12-13 17:18:27 +01:00
Daniel Marjamäki
b4a454fc47
Fixed #1058 (Preprocessor: extracting configuration for '#if DEF == 1')
2009-12-13 15:23:44 +01:00
Daniel Marjamäki
01cfa3b6bd
Fixed #1072 (False positive: class member initialization with '*p=0;')
2009-12-13 09:36:59 +01:00
Daniel Marjamäki
bc808710a0
Fixed #1097 (Internal error: When macro is not expanded 'ABC(for (i=0;i<10;i++) ..);')
2009-12-12 19:58:19 +01:00
Daniel Marjamäki
1002457b17
Fixed #1074 (Exception safety: auto deallocated classes don't leak)
2009-12-12 18:56:26 +01:00
Daniel Marjamäki
c6f913ac3e
Preprocessor: Fixed TODO_ASSERT_EQUALS
2009-12-11 22:32:44 +01:00
Daniel Marjamäki
4d185f0935
Fixed #1080 (false positive: member variable not initialized)
2009-12-11 21:34:04 +01:00
Daniel Marjamäki
9646f62ec1
Fixed #1075 (False positive: uninitialized variable 'return bar(s);')
2009-12-11 19:58:29 +01:00
Daniel Marjamäki
e52fb36c5c
Fixed #1060 (Preprocessor: wrong define handling)
2009-12-11 19:28:37 +01:00
Daniel Marjamäki
91114c50d2
Fixed #1061 (false positve: uninitialized variable)
2009-12-09 20:05:06 +01:00
Daniel Marjamäki
e2473314b5
Fixed #1024 (Preprocessor: doesn't expand macro in macro)
2009-12-09 19:14:07 +01:00
Daniel Marjamäki
418d93eafb
Preprocessor: Refactoring the Preprocessor::expandMacros
2009-12-09 17:13:48 +01:00
Reijo Tomperi
87325799c5
Fix #1071 ((style) The function 'throw' is never used)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1071
2009-12-08 23:41:47 +02:00
Reijo Tomperi
d08d1deab1
Apply patch from #1066 (Speed up cppcheck)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1066
2009-12-08 23:12:49 +02:00
Reijo Tomperi
db30c5b0d2
Fix #1069 (Minor spelling mistake across cppcheck)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1069
2009-12-08 20:10:08 +02:00
Reijo Tomperi
bd024b7a2d
Fix #1065 (Internal error - incrementing single char in char array)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1065
2009-12-07 23:42:30 +02:00
Daniel Marjamäki
e5c507dc02
Fixed #1063 (False positive: deallocated memory doesn't leak upon exception)
2009-12-07 19:23:33 +01:00
Reijo Tomperi
f5849f9be2
Fix #1057 (Tokenizer: negative numbers are not tokenized correctly in switch-case)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1057
2009-12-07 00:09:56 +02:00
Reijo Tomperi
e57d9609a7
small fix to previous commit
2009-12-06 22:32:38 +02:00
Reijo Tomperi
fc40808a8a
Minor refactoring for checkother.cpp
2009-12-06 22:28:38 +02:00
Daniel Marjamäki
8db35189e0
STL: fix iterator bug
2009-12-06 21:21:27 +01:00
Daniel Marjamäki
3100bb3ccc
Visual C++: Suppress compiler warnings
2009-12-06 20:34:02 +01:00