Robert Reif
3fcca23b53
Tokenizer: better handling of bitfields. Ticket: #1956
2010-08-22 09:41:22 +02:00
Robert Reif
77d634127c
Tokenizer: simplify DECLARE_DYNAMIC and DECLARE_DYNCREATE
2010-08-22 09:38:05 +02:00
Robert Reif
ac9078857e
Tokenizer: simplify bitfields. Ticket: #1956
2010-08-21 16:34:41 +02:00
Robert Reif
9c594684db
Tokenizer: handle DECLARE_DYNAMIC. Ticket: #1956
2010-08-21 07:55:14 +02:00
Robert Reif
7173e01926
Fixed #1965 (tokenizer::simplifyEnum add support for C++0x enums)
2010-08-21 07:44:56 +02:00
Robert Reif
7b2b844b8e
Fixed #1964 (False positive: function can be const (get this))
2010-08-20 19:47:41 +02:00
Daniel Marjamäki
741ce40e3d
Tokenizer::setVarId : fixed problem for class members
2010-08-20 19:28:10 +02:00
Daniel Marjamäki
3dd504bcb2
updates of Visual Studio files
2010-08-20 17:59:09 +02:00
Robert Reif
66de0d8f72
Fixed #1954 (False positive: function can be const (derived class))
2010-08-20 07:28:31 +02:00
Robert Reif
f123e951ec
Fixed #1963 (typedef array incorrectly simplified)
2010-08-20 07:11:02 +02:00
Daniel Marjamäki
cfa7b4906e
Symbol database: bug fixes. Ticket: #1895
2010-08-18 22:42:04 +02:00
Daniel Marjamäki
0934035fcf
Fixed #1955 (cppcheck hangs with 100% cpu load)
2010-08-18 22:22:14 +02:00
Daniel Marjamäki
1fd773b245
Fixed #1944 (segfault in Tokenizer::simplifyLogicalOperator)
2010-08-17 20:06:20 +02:00
Daniel Marjamäki
aa00587fed
#1943 (segmentation fault of cppcheck (= default))
2010-08-17 19:50:21 +02:00
Daniel Marjamäki
1faaa5471c
Fixed #1946 ('Dereferenced iterator erased' false positive)
2010-08-17 18:56:11 +02:00
Robert Reif
86f1718b1c
Symbol database: Fixed the error reporting so errors are shown in the gui. Ticket: #1895
2010-08-17 17:20:54 +02:00
Daniel Marjamäki
64cdee62ef
Fixed #1942 (false positive: uninitialized variable in __asm__ statement)
2010-08-16 19:38:47 +02:00
Robert Reif
cc079462dd
Symbol database: fixed problems with namespaces. Ticket: #1895
2010-08-16 18:55:39 +02:00
Daniel Marjamäki
85acb005a2
Fixed #1941 (Internal error::Space Info::getVarList found variable with varid 0)
2010-08-16 18:51:25 +02:00
Sbastien Debrard
296289d190
Refactoring of obsolete functions checks. Ticket: #1940
2010-08-15 21:26:13 +02:00
Daniel Marjamäki
72916caee6
Reverted 7398453cb0
2010-08-15 21:25:14 +02:00
Sbastien Debrard
7398453cb0
Refactoring of obsolete functions checks. Ticket: #1940
2010-08-15 21:22:33 +02:00
Daniel Marjamäki
fe482785aa
Variable Id: Fixed various bugs related to templates and bitfields. Ticket: #1928
2010-08-15 11:54:28 +02:00
Daniel Marjamäki
4949869f5f
removed unused variable 'dot'
2010-08-15 09:03:16 +02:00
Daniel Marjamäki
e1d6320a55
quick fix for #1905 (false positive: the function '...' can be declared as const (member array is assigned))
2010-08-15 08:30:21 +02:00
Robert Reif
556ef9afcf
Symbol database: report error when it is detected that a variable id is missing. Ticket: #1928
2010-08-15 08:03:27 +02:00
Erik Lax
54b7f972c9
Fixed #1932 (false positive: unused private function)
2010-08-15 07:44:08 +02:00
Zachary Blair
c8087d3389
Fixed #162 (Initialisation of a variable by itself)
2010-08-14 21:34:04 -07:00
Daniel Marjamäki
4ff9a1ac94
Fixed #1928 (missing varId for template class variable)
2010-08-14 20:50:49 +02:00
Erik Lax
248bb3b6e8
Fixed #1935 (false negative: detect buffer overrun from network functions (recv, recvfrom..))
2010-08-14 20:19:23 +02:00
Sbastien Debrard
a55a06cea5
Fixed #1933 (Add checks for obsolete functions)
2010-08-14 20:13:46 +02:00
Daniel Marjamäki
00dc3adc18
ErrorLogger: Added better \n handling to the XML output
2010-08-14 18:36:36 +02:00
Daniel Marjamäki
2e249670b3
dangerous scanf usage: Added verbose information
2010-08-14 18:35:48 +02:00
Daniel Marjamäki
5846630fa9
Added scanf check. Modified patch submitted by Eric Sesterhenn
2010-08-14 15:15:12 +02:00
Robert Reif
7c18ece65d
Symbol database: Fixed bug when end of namespace wasn't found. Ticket: #1895
2010-08-14 08:16:53 +02:00
Daniel Marjamäki
6efad92647
dangerous functions: removed 'scanf' because it can be used in a safe way
2010-08-14 07:50:35 +02:00
Robert Reif
db78c3acdf
Symbol database: fixed linenr problem in virtual destructors check
2010-08-13 23:57:53 +02:00
Daniel Marjamäki
e9a3d03372
Dangerous functions: Improved error messages
2010-08-13 22:27:45 +02:00
Erik Lax
032d2678aa
Fixed #1930 (false negative: bad iterators checks fails to detect bugs with preincrement)
2010-08-13 20:54:31 +02:00
Robert Reif
ab7bb876f9
Symbol database: Refactoring virtual destructors check. Ticket: #1895
2010-08-13 18:34:02 +02:00
Robert Reif
a994f235c5
Symbol database: move finding base classes until after all classes are found because of template instantiation. Ticket: #1895
2010-08-13 07:35:30 +02:00
Robert Reif
b92644a30c
Symbol database: refactoring variable handling. Ticket: #1895
2010-08-13 07:34:34 +02:00
Daniel Marjamäki
6cb7fefdbf
Added command line option --report-progress. ticket: #1926
2010-08-12 21:03:33 +02:00
Ettl Martin
a6be941006
actived Wconversion flag in Makefile and fixed almost all Warnings from gcc-4.4
2010-08-12 19:39:19 +02:00
Robert Reif
47c776247a
Symbol database: fix a small bug and add more tests. ticket: #1895
2010-08-12 07:38:27 +02:00
Robert Reif
c88aa242e8
Symbol database: better handling of 'friend'. ticket: #1895
2010-08-11 22:36:04 +02:00
Daniel Marjamäki
cb72f21994
Optimisation in Tokenizer::tokenize
2010-08-11 17:29:33 +02:00
Daniel Marjamäki
0ea9e98680
Optimisation: Made inner loop in Tokenizer::setVarId faster
2010-08-10 19:06:45 +02:00
Daniel Marjamäki
a1f288d088
Tokenizer::setVarId : Fixed a problem when using static class members
2010-08-10 18:22:58 +02:00
Robert Reif
03c436a735
Symbol database: Refactoring
2010-08-10 18:01:33 +02:00
Robert Reif
483a3ddfe1
Fixed #1925 (fix some cppcheck warnings in cppcheck)
2010-08-10 07:26:59 +02:00
Robert Reif
217b9425b5
Fixed #1922 (False positive: function can be const when both const and non-const functions are provided.)
2010-08-09 17:54:16 +02:00
Robert Reif
12523bc745
Symbol database: Enhancements and fixes. Ticket: #1895
2010-08-09 17:50:26 +02:00
Daniel Marjamäki
6a3befa720
Optimising: Tokenizer::setVarId when setting variable ids for struct/class members
2010-08-08 19:14:23 +02:00
Daniel Marjamäki
195b48e81f
astyle formatting
2010-08-08 18:55:15 +02:00
Daniel Marjamäki
1d79c164c4
Optimisation: Optimised firstWordEquals
2010-08-08 18:54:49 +02:00
Daniel Marjamäki
5a8181d425
Tokenizer: 'simplifyCalculations();' should have the same results as 'while (simplifyCalculations());'
2010-08-08 09:25:09 +02:00
Daniel Marjamäki
11ef2c0a06
Refactoring: Cppcheck::reportProgress needs to call _errorLogger::reportProgress. Ticket: #1625
2010-08-08 08:46:47 +02:00
Daniel Marjamäki
1555901077
Refactoring: Made Tokenizer::simplifyCalculations a little faster
2010-08-08 08:28:28 +02:00
Daniel Marjamäki
764ce99c6f
Performance: Refactoring CheckOther::nullPointerStructByDeRefAndChec to make it faster
2010-08-07 21:00:17 +02:00
Daniel Marjamäki
dcf54621d4
visual studio: fixed a few compiler warnings (when saving istream::get result in a char)
2010-08-07 20:33:24 +02:00
Daniel Marjamäki
029613d4c4
Fixed #1923 (False positive: Possible null pointer derefence in else if)
2010-08-07 19:59:56 +02:00
Daniel Marjamäki
262885f3e0
Fixed #1921 (false positive: the function '...' can be declared as const (inline friend))
2010-08-07 16:08:44 +02:00
Daniel Marjamäki
ed4f1164a1
Fixed #1894 (unreadVariable false positive with const references)
2010-08-07 15:53:51 +02:00
Daniel Marjamäki
050011d287
Fixed #1881 (false positive: The function '...' can be const (nonconst code is hidden inside #if))
2010-08-07 13:08:36 +02:00
Daniel Marjamäki
54121a74ff
Symbol Database: Don't use it when it is not needed
2010-08-07 12:41:11 +02:00
Daniel Marjamäki
9e7b087832
Refactoring: Made CheckClass members private
2010-08-07 12:26:42 +02:00
Daniel Marjamäki
c395e51389
New check: look for calculation inside sizeof
2010-08-06 22:57:10 +02:00
Daniel Marjamäki
7911626aed
gcc: fixed some more -Wsign-conversion warnings
2010-08-06 22:43:06 +02:00
Daniel Marjamäki
12217461a2
gcc: fixed some more -Wsign-conversion warnings
2010-08-06 22:37:48 +02:00
Daniel Marjamäki
adc47f1820
Fixed #1487 (fix gcc compiler warnings)
2010-08-06 21:02:43 +02:00
Daniel Marjamäki
271a74a16c
gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487
2010-08-06 19:42:31 +02:00
Daniel Marjamäki
faa713e7b5
gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487
2010-08-06 19:40:54 +02:00
Daniel Marjamäki
290d02780f
gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487
2010-08-06 19:38:21 +02:00
Daniel Marjamäki
3adfc61eca
gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487
2010-08-06 19:15:44 +02:00
Daniel Marjamäki
146465a6ad
gcc: Fixed some compiler warnings when using -Wsign-conversion. Ticket: #1487
2010-08-06 18:42:55 +02:00
Daniel Marjamäki
7fb44d1995
gcc: fixed some compiler warnings when using -Wsign-conversion
2010-08-06 18:32:31 +02:00
Daniel Marjamäki
6346e1aa90
Borland C++: Fixed compiler errors
2010-08-06 17:44:26 +02:00
Daniel Marjamäki
f5823f7747
Visual Studio: Fixed warnings
2010-08-06 17:32:16 +02:00
Daniel Marjamäki
567f1da4b4
Preprocessor: Compiler dependent parsing of '<backspace><space><newline>'. Maybe it should be possible to control it from the commandline instead. Ticket: #640
2010-08-06 08:50:31 +02:00
Daniel Marjamäki
32d98969fb
suppress visual studio warnings about loosing data when calculating Token::progressValue
2010-08-05 21:40:04 +02:00
Daniel Marjamäki
eedb5e383e
Memory leaks: better handling of 'return strcmp(..' etc
2010-08-05 21:23:32 +02:00
Daniel Marjamäki
81c058f2be
Merge branch 'master' of github.com:danmar/cppcheck
2010-08-05 19:02:21 +02:00
Daniel Marjamäki
2450a80556
Visual Studio: Added /MP switch
2010-08-05 19:02:05 +02:00
Ettl Martin
d16944398a
fixed compiler Warning in lib/checkbufferoverrun about comparison of signed and unsigned variable
2010-08-05 18:58:58 +02:00
Daniel Marjamäki
1b2f16f443
Buffer overflow: Fixed two TODO test cases
2010-08-05 11:01:47 +02:00
Daniel Marjamäki
65f7bcbfa5
null pointers: fixed TODO assertion - dereference pointer in function call and then checking that it is not NULL
2010-08-05 08:19:36 +02:00
Daniel Marjamäki
6f228033d2
null pointers: fixed todo test case
2010-08-05 08:06:19 +02:00
Daniel Marjamäki
9d24c9ceaa
Memory leaks: refactoring return handling
2010-08-04 23:01:32 +02:00
Daniel Marjamäki
239d264432
uninitialized variables: fixed false negatives when uninitialized pointer data is read
2010-08-04 21:13:40 +02:00
Daniel Marjamäki
6d94c4f15e
Memory leaks: don't translate 'return p[10];' to 'return use ;'
2010-08-04 20:48:20 +02:00
Daniel Marjamäki
33bf8bf730
Fixed #1670 (False negative: Array index out of bounds in return statement)
2010-08-04 20:38:52 +02:00
Daniel Marjamäki
c9b1804954
astyle formatting
2010-08-04 20:28:41 +02:00
Daniel Marjamäki
08e2d91372
Fixed #1919 (option '--suppressions file' can not work when filename includes colon)
2010-08-03 17:52:03 +02:00
Daniel Marjamäki
9edecd4a3f
Added ErrorLogger::reportProgress and removed ErrorLogger::ReportProgress. This will make it easier for GUI and other clients to display progress information.
2010-08-03 16:36:21 +02:00
Daniel Marjamäki
6700351ede
Fixed #1833 (memory leak detected in version 1.37 not detected in 1.43)
2010-08-02 23:04:23 +02:00
Daniel Marjamäki
ff9d3d0965
memory leaks: better handling of 'loop { dealloc ; alloc ; }'
2010-08-02 22:17:09 +02:00
Daniel Marjamäki
ae0252dc91
memory leaks: simplify 'callfunc ; ;'
2010-08-02 21:59:47 +02:00
Daniel Marjamäki
df44703ee9
memory leaks: better checking of function calls. If there are statements after the function call it is unlikely the function call is noreturn
2010-08-02 21:56:50 +02:00
Kimmo Varis
2fa4378338
Astyle cleanup with new Astyle options.
2010-07-31 15:44:08 +03:00
Daniel Marjamäki
a274cb1015
cleanup headers
2010-07-31 08:52:28 +02:00
Daniel Marjamäki
694325d51f
Fixed #1912 (False positive: memory leak (calling noreturn function))
2010-07-30 08:50:10 +02:00
Daniel Marjamäki
2e2baa23a6
Fixed #1909 (### Internal error in Cppcheck. Please report it)
2010-07-28 21:03:15 +02:00
Ettl Martin
9fa6b20b9d
checkheaders: removed redundant include (token.h) from errorlogger.cpp
2010-07-27 21:40:38 +02:00
Daniel Marjamäki
81d7a37b68
Fixed #1864 (Relative Path of #include-File doesn't work)
2010-07-27 18:07:30 +02:00
Daniel Marjamäki
2fd2ab1712
Fixed a vs compiler warning. Ticket: #1901
2010-07-27 17:48:22 +02:00
Kimmo Varis
45a6742e3f
Windows: Add _CRT_SECURE_NO_WARNINGS define.
...
The _CRT_SECURE_NO_WARNINGS define suppresses some Windows-specific
compile warnings. Windows has "secure" versions of some functions
and compiler outputs warnings that those "secure" versions should
be used instead. Since other platforms don't have those functions
we just suppress this warning for now on.
2010-07-27 17:34:13 +03:00
Daniel Marjamäki
94acebc3d0
Cleanup redundant include
2010-07-27 09:32:20 +02:00
Zachary Blair
9f44d9eb62
Fixed #1889 (false positive: Common realloc mistake)
2010-07-26 23:17:27 -07:00
Daniel Marjamäki
7c5219324e
Refactoring: Cleanup include that checkheaders reported as not needed
2010-07-26 22:05:51 +02:00
Kimmo Varis
17395b310d
Remove unneeded path separator conversion.
2010-07-26 22:49:47 +03:00
Kimmo Varis
2f8d43984f
Fix path separators for couple of messages.
2010-07-26 22:43:49 +03:00
Kimmo Varis
7b8cb17a44
Windows: convert to internal separators when finding files.
2010-07-26 22:16:19 +03:00
Kimmo Varis
60cf37d1ef
Update VS 2010 project files.
2010-07-26 22:06:33 +03:00
Robert Reif
0bb07e6947
Create a symbol database
2010-07-26 16:46:37 +02:00
Daniel Marjamäki
bb7484945a
Fixed #1887 (internal error in GLee)
2010-07-25 18:20:30 +02:00
Daniel Marjamäki
e358af9018
Refactoring: Report progress when checking takes a long time. Ticket: #1868
2010-07-25 18:19:37 +02:00
Daniel Marjamäki
786ca037ec
Refactoring: changed 'bool varid=0' to 'bool varid=false'
2010-07-25 18:17:44 +02:00
Daniel Marjamäki
29b2be19ab
Fixed #1383 (Preprocessor: define - ifndef problem)
2010-07-25 15:19:25 +02:00
Daniel Marjamäki
0c65796984
Refactoring: Cleanup headers using checkheaders
2010-07-24 22:12:56 +02:00
Daniel Marjamäki
19e26c3b80
CheckBufferOverrun: report progress. Ticket: #1868
2010-07-24 20:54:42 +02:00
Daniel Marjamäki
b8146271a2
Report progress when checking a file takes a long time. Ticket: #1868
2010-07-24 18:58:52 +02:00
Daniel Marjamäki
05c4138b2f
Refactoring: Removed unused variable _xmllist
2010-07-24 18:57:38 +02:00
Daniel Marjamäki
9c17114668
Fixed #1893 (false positive: dereferencing null pointer (try/catch))
2010-07-24 14:27:18 +02:00
Daniel Marjamäki
dfbdd8f9c4
Refactoring Token::Match: Report errors through ErrorLogger. Ticket: #1839
2010-07-24 10:51:17 +02:00
Daniel Marjamäki
9b49202da8
Refactoring Tokenizer::syntaxError
2010-07-24 10:39:01 +02:00
Daniel Marjamäki
dd07d82c34
Refactoring MathLib: Report errors through the tokenizer. Ticket: #1839
2010-07-24 10:25:03 +02:00
Daniel Marjamäki
84e576de04
Refactoring: use MathLib add/sub instead of calculate
2010-07-24 10:13:45 +02:00
Daniel Marjamäki
3ad8f98c61
Refactoring: Settings::addSuppression return error message and callers make sure it's reported properly. Ticket: #1839
2010-07-23 23:12:56 +02:00
Daniel Marjamäki
5c771adece
Refactoring: Use Check::reportError instead of writing to std::cout. Ticket: #1839
2010-07-23 22:53:29 +02:00
Daniel Marjamäki
8a0d989190
Refactoring: Don't throw exceptions in the tokenizer upon errors. Ticket: #1866
2010-07-23 14:02:29 +02:00
Daniel Marjamäki
5e0a4a173a
Refactoring: The preprocessor will report errors instead of throwing exceptions. Ticket: #1866
2010-07-23 13:54:52 +02:00
Daniel Marjamäki
37c959023a
Refactoring: The Settings::addEnabled will return error message instead of throwing it. Ticket: #1866
2010-07-23 13:29:16 +02:00
Daniel Marjamäki
1b7796791b
Variable scope: Improved verbose information (see also 7ef0296
)
2010-07-23 12:29:21 +02:00
Daniel Marjamäki
e1612bc175
Fixed #1891 (Internal error when enum assigned to sizeof without brackets)
2010-07-22 22:21:12 +02:00
Daniel Marjamäki
f69109fbf6
Fixed #1828 (### Internal error in Cppcheck. Please report it.)
2010-07-22 19:57:48 +02:00
Kimmo Varis
b4d55d8e65
Fix path separators for missing include files-message.
2010-07-21 17:00:12 +03:00
Kimmo Varis
9b0851ed25
Fixed #1892 (Verbosity setting set to false and not set back to original value)
...
Verbosity was set to false to temporarily reduce printing messages.
But it was not set back to its original value so rest of the
messages that should have been printed for verbose setting
enabled were not printed.
2010-07-21 16:26:59 +03:00
Kimmo Varis
618076a65f
Better fix for #1371 .
...
Now handles also system includes. And have couple of tests.
2010-07-21 14:16:42 +03:00
Kimmo Varis
9d29ee6edd
Use enum for header file types
2010-07-21 12:58:30 +03:00
Robert Reif
f2f5b3ebf0
Fixed #1883 (false positive: (style) The function 'A::SetPos' can be const)
2010-07-20 09:43:27 +02:00
Kimmo Varis
c25930581c
Formatting and improving comments.
2010-07-19 20:06:42 +03:00
Daniel Marjamäki
3c376047ba
pulled changes from kimmov (filelocation-refactor)
2010-07-19 18:06:49 +02:00
Zachary Blair
df1c911d84
Merge branch 'master' of github.com:danmar/cppcheck
2010-07-19 07:49:44 -07:00
Kimmo Varis
342632a618
Remove './' from begin of paths when printing progress.
2010-07-19 15:05:44 +03:00
Kimmo Varis
dc77bc69a0
Move path simplifying code to Path class.
2010-07-19 14:27:05 +03:00
Robert Reif
4cf92992a8
Fixed #1883 (false positive: (style) The function 'A::SetPos' can be const)
2010-07-19 13:16:11 +02:00
Daniel Marjamäki
d4d0bc050a
Fixed #1865 (Tokenizer::simplifyRedundantParantheses: wrong handling of 'operator delete')
2010-07-19 12:06:20 +02:00
Kimmo Varis
0485976c54
Use std::replace() to replace chars in paths.
2010-07-19 13:02:04 +03:00
Daniel Marjamäki
7ef0296f97
--verbose: added more information for the variableScope error message.
2010-07-19 11:30:01 +02:00
Kimmo Varis
c8d866b906
Merge remote branch 'remotes/kimmo/master'
2010-07-19 11:10:04 +03:00
Kimmo Varis
9f78177914
Remove unused methods from ErrorLogger.
2010-07-19 11:04:30 +03:00
Daniel Marjamäki
bbf2c6c6e6
Fixed #1880 (false positive: Uninitialized array (initialized in subfunction))
2010-07-19 10:03:54 +02:00
Kimmo Varis
95fa267c0e
Remove misleading comment.
2010-07-19 10:54:53 +03:00
Zachary Blair
9ffd06ff5e
Fixed #1856 (false positive: "pData" nulled but not freed upon failure)
2010-07-18 23:55:39 -07:00
Robert Reif
37b37218cf
Fixed #1882 (false negative: function can be declared const)
2010-07-19 08:40:46 +02:00
Robert Reif
7842658cb4
Refactoring CheckClass::initializeVarList. Ticket #1811
2010-07-18 20:58:16 +02:00
Daniel Marjamäki
e7690836fd
fixed the mistake I made when applying patch
2010-07-18 20:56:19 +02:00
Robert Reif
689de10abf
uninitialized class members: better handling of nested classes
2010-07-18 20:43:51 +02:00
Kimmo Varis
b384aabc52
Fixed #1371 (#include "foo\file.h" -> #include "foo/file.h" should be handled automatically on linux)
...
Linux can't open file paths with / separator. So we'll need to fix
such include file paths (in source files) first.
2010-07-18 20:02:18 +03:00
Daniel Marjamäki
1fb4758583
Fixed #1855 (false positive: uninitialized variable (function call in switch condition))
2010-07-18 13:19:37 +02:00
Daniel Marjamäki
020a8a965c
use cppcheckError to report Tokenizer/Preprocessor error instead of std::cerr
2010-07-18 12:57:29 +02:00
Daniel Marjamäki
a4b887f21a
Fixed #1843 (Tokenizer::createTokens() calls std::exit(0))
2010-07-18 12:44:55 +02:00
Daniel Marjamäki
c16b5d6f3a
Fixed #1857 (XML tag no more included for unusedFunction error (1.44 regression))
2010-07-18 11:22:26 +02:00
Kimmo Varis
006c9f17d4
GUI: Avoid unnecessary path separator conversion.
2010-07-18 11:20:10 +03:00
Robert Reif
81a053aa90
Fixed #1311 (false negative: missing const not found in derived classes)
2010-07-18 10:18:41 +02:00
Kimmo Varis
6903f61f69
Update Visual Studio projects.
2010-07-17 17:59:47 +03:00
Kimmo Varis
5d1a10b0a3
Astyle cleanup.
2010-07-17 17:42:17 +03:00
Kimmo Varis
3c12d23fd9
Add Path class for path handling routines.
...
In this initial commit the Path class contains two methods for
converting path separators. I want to move cppcheck path handling
to direction that we internally have paths with / separator. And
convert from/to native separators when needed.
2010-07-17 17:38:36 +03:00
Robert Reif
9c4bbd4c65
Fixed #1730 (False negative in 'variable not initialized in ctor')
2010-07-17 12:26:05 +02:00
Robert Reif
ad9d1375aa
Fixed #1875 (CheckClass::getVarList: simplify function use)
2010-07-17 12:25:14 +02:00
Kimmo Varis
6db365e6f7
Improve path name handling in ErrorLogger.
...
This commit adds setfile() method to FileLocation class. The setfile
method converts in Windows path separators to internally used Unix
separators. And getfile() converts path separators back to Windows
separators. This fixes bugs that error reports had mixed path
separators in paths.
2010-07-17 01:27:40 +03:00
Kimmo Varis
6362e50e73
Fix comment.
2010-07-16 22:47:46 +03:00
Kimmo Varis
3fa4e8a1d5
Remove unused ErrorLogger::_writemsg() methods.
2010-07-16 21:40:02 +03:00
Robert Reif
d72365ab00
Fixed #1375 (false negative: uninitialized member variables not found in nested class constructors)
2010-07-15 10:16:16 +02:00
Kimmo Varis
ad0394939a
Refactor ErrorMessage constructor to take Severity::SeverityType.
...
This removes lots of unneeded casting as everybody now uses the
Severity::SeverityType.
2010-07-14 23:11:32 +03:00
Kimmo Varis
d811970531
Merge remote branch 'remotes/kimmo/severity-refactor'
2010-07-14 22:29:02 +03:00
Kimmo Varis
ba5017cf05
Add debug-severity to Severity::SeverityType.
2010-07-14 21:12:54 +03:00
Kimmo Varis
f54f28530b
Make Severity::none to match and output empty string.
2010-07-14 21:12:54 +03:00
Kimmo Varis
5f8af2e1e8
Refactor ErrorMessage's severity to Severity::SeverityType.
2010-07-14 21:12:39 +03:00
Robert Reif
fd352865ca
CheckClass: Improvements and refactorings for constructors and variables checking
2010-07-14 19:00:52 +02:00
Daniel Marjamäki
a6b6022497
Fixed #1851 (false positive: Member variable not initialized int ctor)
2010-07-14 18:50:29 +02:00
Kimmo Varis
fa0f6edacf
Rename ErrorMessage::toText() to ErrorMessage::toString().
2010-07-14 18:31:05 +03:00
Kimmo Varis
05adb285c5
Rename Severity::stringify() to Severity::toString().
2010-07-14 17:40:18 +03:00
Kimmo Varis
3716b3f9d8
Rename Severity::e to Severity::SeverityType.
2010-07-14 17:30:03 +03:00
Daniel Marjamäki
bea714445a
Fixed #1850 (An access to a nested std::map via a negative integer key is reported as 'Array index out of bounds')
2010-07-14 12:24:07 +02:00
Daniel Marjamäki
233432a888
gcc: fixed compiler warning (suggest parantheses)
2010-07-14 09:46:08 +02:00
Daniel Marjamäki
a1ce80806e
Fixed #1844 (False positive: invalid iterator when erase() is used in if-else (with continue))
2010-07-14 09:42:10 +02:00
Robert Reif
c572e6af87
Fixed #1846 (False positive with -s: Variable hides typedef with same name)
2010-07-13 08:08:12 +02:00
Robert Reif
ab088bcec9
Fixed #1847 (False positive: Method using std::swap<>() can be declared const)
2010-07-13 08:04:48 +02:00
Daniel Marjamäki
61150498c4
Variable Id: fixed issue with function call. Ticket: #1848
2010-07-12 20:18:03 +02:00
Robert Reif
e86e8449f8
Variable usage: better handling of pointer aliasing. Ticket: #1729
2010-07-12 09:50:18 +02:00
Kimmo Varis
c9215e9e44
Change the "information" error to "debug" error.
...
There was one debugging error sent with "information" severity. That
confused the GUI that didn't know such severity. Change the severity
to "debug" so the meaning of the error is more clear.
2010-07-12 00:56:52 +03:00
Daniel Marjamäki
94a8eba989
1.44: updated version information
2010-07-10 11:29:07 +02:00
Daniel Marjamäki
4b0e3edfa4
Unit Testing: Test that suppressions work
2010-07-09 13:27:15 +02:00
Daniel Marjamäki
abbd557761
Fixed #1836 (--suppresions file.txt fails due to wrong line edings)
2010-07-09 12:42:08 +02:00
Daniel Marjamäki
2531bb73d7
Fixed #1834 (False positive: invalid iterator when erase() is used in if-else)
2010-07-09 10:50:24 +02:00
Daniel Marjamäki
a60047227d
Settings: added '#include <cctype>'
2010-07-09 10:18:35 +02:00
Daniel Marjamäki
c34c3ee742
Unused functions: Refactoring
2010-07-08 13:01:53 +02:00
Daniel Marjamäki
1876cd482b
Suppressions: Validate given id
2010-07-08 12:06:27 +02:00
Daniel Marjamäki
11a72461f3
Fixed #1835 (false positive: uninitialized variable when using ?)
2010-07-08 11:16:49 +02:00
Robert Reif
566b4b4beb
Variable usage: fixed false positive reported in #1729
2010-07-08 08:42:34 +02:00
Robert Reif
2d6dfa57e1
Variable usage: Better aliasing support (Ticket #1729 )
2010-07-08 08:00:50 +02:00
Daniel Marjamäki
49626e427e
Realloc: changed the error message. I think it's better to mention realloc in the message.
2010-07-07 20:28:15 +02:00
Daniel Marjamäki
a1793edabe
Fixed #1825 (*log(0) error)
2010-07-07 09:03:40 +02:00
Daniel Marjamäki
4ebf4caf66
Variable usage: only warn about variables that have variable id > 0
2010-07-07 08:50:34 +02:00
Daniel Marjamäki
2bb07a55bd
Fixed #1803 (False positive: unused variable: this)
2010-07-07 08:39:18 +02:00
Daniel Marjamäki
a107cd1b59
Fixed #1729 (False positive: variable is assigned a value that is never used (pointer aliasing))
2010-07-07 08:26:24 +02:00
Robert Reif
b0f1d5669b
Fixed #1829 (### Internal error in Cppcheck. Please report it.)
2010-07-07 07:40:11 +02:00
Daniel Marjamäki
dc2a0a6468
Fixed #1789 (false positive: memory leak (reallocation in subfunction through parameter))
2010-07-06 21:36:50 +02:00
Daniel Marjamäki
1b20f8d27d
Fixed #1824 (false positive: unitialised variable)
2010-07-06 13:18:28 +02:00
Robert Reif
1799e4a575
Fixed #1827 (### Internal error in Cppcheck. Please report it.)
2010-07-06 08:26:30 +02:00
Robert Reif
c949a29d1e
Fixed #1821 (simplifyTypedef: better typedef support)
2010-07-05 23:03:54 +02:00
Daniel Marjamäki
18a75edd20
Fixed #1823 (tokenize && wrong)
2010-07-05 22:41:02 +02:00
Daniel Marjamäki
b02fc037ed
Buffer Overrun: Fixed false positive when variable is reassigned in called function
2010-07-05 22:19:27 +02:00
Daniel Marjamäki
ae3557fa92
Fixed #1820 (False positive: memory leak (auto deallocated class))
2010-07-05 14:01:25 +02:00
Daniel Marjamäki
b173d5f117
Fixed #1817 (False positive: Resource leak (casting))
2010-07-05 13:16:33 +02:00
Daniel Marjamäki
c811acaa50
Fixed #1818 (False positive: Dangerous usage of strncpy (copying a constant string))
2010-07-05 12:45:39 +02:00
Robert Reif
28c265b20c
Fixed #1821 (simplifyTypedef: better typedef support)
2010-07-02 15:22:29 +02:00
Daniel Marjamäki
3205775eb9
Fixed #1790 (mismatching allocation/deallocation false positive)
2010-06-30 09:21:15 +02:00
Zachary Blair
5ea28ccbba
Fixed #157 (Forgetting to put a break in a switch statement)
2010-06-30 00:10:30 -07:00
Daniel Marjamäki
c6888845a0
Fixed #1815 (False positive: uninitialized variable when using ? operator)
2010-06-30 08:28:34 +02:00
Robert Reif
b33fb48618
Fixed #1816 (Tokenizer: remove restrict keyword)
2010-06-30 08:10:39 +02:00
Daniel Marjamäki
76133e0234
Class checking: Fixed FP for static arrays (not initialized in constructor)
2010-06-29 12:51:18 +02:00
Robert Reif
4668359b51
Fixed #1808 (false positive: uninitialized variable with multiple assignment)
2010-06-29 08:38:24 +02:00
Daniel Marjamäki
46e2f1e64b
--author=Robert Reif <reif@earthlink.net>
...
Fixed #1814 (false positive: Variable hides typedef with same name)
2010-06-28 15:33:27 +02:00
Daniel Marjamäki
f82895c1f2
Fixed #1809 (false positive: uninitialized variable with nested if)
2010-06-26 17:15:44 +02:00
Robert Reif
539804369a
Fixed #1811 (false positive: Uninitialized variable)
2010-06-26 07:50:53 +02:00
Daniel Marjamäki
ad0908cb3f
Fixed #1808 (false positive: uninitialized variable with multiple assignment)
2010-06-25 19:39:30 +02:00
Robert Reif
38f90dae09
Fixed #1813 (false negative: Member variable not assigned a value in operator=)
2010-06-25 07:52:12 +02:00
Daniel Marjamäki
9fd89d3bdc
Fixed #1495 (False -s positive: Member variable not assigned a value in operator=)
2010-06-24 20:09:26 +02:00
Robert Reif
2a1edff77f
Fixed #1812 (false negative: functionVariableUsage doesn't support static variables)
2010-06-24 17:00:32 +02:00
firewave
6fd4ba6e4f
Avoid Visual Studio warnings about constant expressions
2010-06-24 04:24:25 +02:00
Robert Reif
74e48d4bb1
Fixed #1732 (False positive: Variable not assigned a value (pointer to pointer))
2010-06-23 06:54:14 +02:00
Robert Reif
fac9f66cc0
Fixed #1810 (False positive: Variable 'separator' is assigned a value that is never used)
2010-06-22 17:07:41 +02:00
Robert Reif
a5b45a7f83
Fixed #1807 (false positive: Variable is not assigned a value (casting function parameters))
2010-06-22 17:04:11 +02:00
Daniel Marjamäki
d22da6088c
Fixed #1800 (false positive: memory leak when ptr used as map key)
2010-06-21 18:43:28 +02:00
Robert Reif
bdd28b47aa
Fixed #1799 (false positive: Variable is assigned a value that is never used)
2010-06-21 18:12:01 +02:00
Daniel Marjamäki
26e167fd5b
Refactoring: Removed redundant checks
2010-06-20 20:51:36 +02:00
Daniel Marjamäki
4cd3e8fdc0
Refactoring: Reduced copy/pasted code
2010-06-20 19:03:59 +02:00
Daniel Marjamäki
54b8e79cae
Preprocessor: Reduce copy/pasted code
2010-06-20 18:41:45 +02:00
Nicolás Alvarez
c76a9525c1
Change size-t to std::string::size_type.
2010-06-19 17:24:10 -03:00
Nicolás Alvarez
12d6947334
Fix build error on 64-bit systems.
2010-06-19 17:16:14 -03:00
Nicolás Alvarez
df3d98a7c2
Fix typos in sizeofsizeof error message.
2010-06-19 17:16:14 -03:00
Daniel Marjamäki
85bf4b2be6
Fixed #1795 (false positive: nullpointer dereference (needs to improve Tokenizer::simplifyKnownVariables))
2010-06-19 17:54:38 +02:00
Daniel Marjamäki
82b63dd736
Fixed #1633 (tokenizer: simplifyKnownVariable: improved handling of arithmetic)
2010-06-19 14:00:45 +02:00
Daniel Marjamäki
a402b6bb98
Fixed #1802 (Preprocessor: macros are expanded wrong)
2010-06-19 12:03:39 +02:00
Daniel Marjamäki
38c3de7343
Preprocessor: Refactoring. Broke out code that parses out the parameters from code.
2010-06-19 09:09:47 +02:00
Daniel Marjamäki
dcdbe117e6
Borland C++: Fixed compiler errors. When using 'a?b:c', Borland requires that b and c are the same type
2010-06-19 08:52:14 +02:00
Robert Reif
ec61c6fa26
Fixed #1801 (simplifyTypedef: duplicate typedefs not handled properly)
2010-06-18 07:16:05 +02:00
firewave
d6d4b99b85
Removed obsolete checkheaders from Visual Studio projects
2010-06-17 15:00:58 +02:00
Robert Reif
f116e74f6e
Fixed #1801 (Segmentation fault while scanning Qt's qcups.cpp)
2010-06-17 06:59:01 +02:00
Leandro Lisboa Penz
58a872e6a0
Fixed #1789 (false positive: memory leak (reallocation in subfunction through parameter))
...
Detecting reallocations in the other function.
2010-06-16 22:29:55 -03:00
Daniel Marjamäki
8a6f4254e0
Fixed #853 (False positive: memory leak for member variable with unknown function)
2010-06-16 19:28:47 +02:00
Robert Reif
ee7ad272d6
variable usage: fix false positives when __attribute__ is used. Ticket: #1792
2010-06-16 18:04:31 +02:00
Robert Reif
7dba21858a
simplify the alias handling in the checking of variable usage. Ticket: #1729
2010-06-16 18:00:21 +02:00
Robert Reif
61e7e759f0
Fixed #1798 (structure templates)
2010-06-16 07:13:52 +02:00
Zachary Blair
ae2a02ad93
Applied review suggestions for Ticket #920
2010-06-15 22:03:38 -07:00
Daniel Marjamäki
dc12a9b3b5
Fixed #1545 (new check: usage of iterator pointing to invalid memory after reserve)
2010-06-15 19:53:09 +02:00
Daniel Marjamäki
a42273da63
Fixed #887 (Tokenizer: Simplify variable value after loop)
2010-06-15 17:56:14 +02:00
Daniel Marjamäki
5c00c1a539
removed the deprecated checkheaders
2010-06-15 16:56:04 +02:00
Zachary Blair
efefceabae
Fixed #920 (new style check: find empty catch blocks)
2010-06-14 23:45:46 -07:00
Robert Reif
98ae660260
Fixed #1792 (false positive: Variable 'test' is assigned a value that is never used)
2010-06-14 15:46:57 +02:00
Daniel Marjamäki
cb7e9fbec1
Fixed #1776 (False Negative: Unitialized array)
2010-06-14 08:36:34 +02:00
Daniel Marjamäki
b5d0955d11
doxygen: fixed error messages given by doxygen
2010-06-14 07:54:41 +02:00
Daniel Marjamäki
e987d2e05b
Memory leaks: more specific bailouts to reduce false negatives
2010-06-13 19:00:11 +02:00
Daniel Marjamäki
5de124280a
Fixed #1783 (false positive: uninitalized variable in constructor/operator=, when calling overloaded functions)
2010-06-13 10:23:59 +02:00
Daniel Marjamäki
70bfa890a8
Fixed #1718 (Tokenizer add close braces to for loop at wrong place when if-else presents inside)
2010-06-13 08:00:46 +02:00
Robert Reif
18bb7488b9
Fixed #1787 (false negative: out of bounds in derived class)
2010-06-13 07:17:50 +02:00
Daniel Marjamäki
76221c0916
Fixed #1510 (false positive '(possible error) Memory leak' when 'a = b = new ...; delete a' (but not b))
2010-06-12 13:37:44 +02:00
Daniel Marjamäki
f3fbdc96e1
Fixed #1788 (Tokenizer: template destructor is lost)
2010-06-12 08:32:05 +02:00
Robert Reif
3d2c28a524
Fixed #1784 (false positive: Variable is not assigned a value)
2010-06-10 07:21:47 +02:00
Robert Reif
6b65b77acf
Fixed #1782 ((error) ### Internal error in Cppcheck. Please report it.)
2010-06-10 07:18:55 +02:00
Daniel Marjamäki
e64ce2e812
Fixed #1781 (false positive: uninitialized variable when using asm statement in macro)
2010-06-09 21:28:15 +02:00
Robert Reif
00dcec47ac
Variable usage: read variable when using syntax '..=*(p);'
2010-06-08 18:26:14 +02:00
Daniel Marjamäki
472bd9dabe
Fixed #1726 (False negative: null pointer dereference in switch block)
2010-06-06 12:15:31 +02:00
Daniel Marjamäki
e140ff6e84
Memory leaks: skipping function call inside allocation
2010-06-06 11:22:59 +02:00
Daniel Marjamäki
a9196e8710
Memory leaks: Added allocation function 'g_strdup_printf'
2010-06-06 11:09:19 +02:00
Daniel Marjamäki
68ad8219ed
Fixed #1722 (Member variable initialized in call to base class constructor)
2010-06-06 08:29:35 +02:00
Martin Ettl
f75ca79849
applied patch from php-coder from ticket 1724; removed TODO_TESTCASES;
2010-06-05 19:49:49 +02:00
Daniel Marjamäki
1de6e94947
Code coverage: Removed unused code
2010-06-05 11:25:47 +02:00
Daniel Marjamäki
07e00d57d9
Fixed #1725 (segfault in ExecutionPath::bailOutVar (probably caused by #1721 fix))
2010-06-05 09:45:35 +02:00
Leandro Lisboa Penz
4ac7da7d51
Fixed #73 (memory leaks not found when calling a function that returns allocated memory through a parameter)
2010-06-04 20:58:50 -03:00
Zachary Blair
2645e96783
Applied review suggestions for Ticket #568
2010-06-03 22:42:54 -07:00
Daniel Marjamäki
b11e23eb08
Fixed #1721 (False negative: uninitialized variable in switch block)
2010-06-03 20:02:58 +02:00
Robert Reif
4c4844b722
Fixed #1723 (Variable assigned value which is never used but is thrown)
2010-06-03 07:05:57 +02:00
Daniel Marjamäki
09e02b9f9f
updated --help output. The --enable is used to enable additional checks.
2010-06-02 21:34:03 +02:00
Daniel Marjamäki
cb43168d81
Fixed #1720 (segmentation fault of cppcheck)
2010-06-02 18:10:32 +02:00
Daniel Marjamäki
5789eb116d
astyle formatting
2010-06-02 18:09:25 +02:00
Daniel Marjamäki
8ead23fc91
CheckOther::nullConstantDereference: Fixed cppcheck warning message - tok may become null
2010-06-02 18:06:37 +02:00
Daniel Marjamäki
28ad69e4b3
Refactoring of CheckOther::nullConstantDereference
2010-06-02 17:53:45 +02:00
Zachary Blair
33b4254d33
Fixed #568 (string functions with command line arguments may overflow buffer)
2010-06-01 22:41:07 -07:00
Daniel Marjamäki
45821b3871
Fixed #1719 (False negative: memory leak (fgets in condition))
2010-05-31 18:20:34 +02:00
Daniel Marjamäki
9b1ed1112b
Memory leaks: Fixed bug in CheckMemoryLeak::functionReturnType
2010-05-30 20:30:08 +02:00
Daniel Marjamäki
08b6e6ee09
Fixed #1717 (False positive: Resource leak with while)
2010-05-30 13:15:15 +02:00
Daniel Marjamäki
83c62eca9c
Tokenizer: simplify loops that continue while errno is EINTR
2010-05-30 12:49:39 +02:00
firewave
62093d764d
Fixed Visual Studio 2010 warning
2010-05-30 10:44:03 +02:00
Daniel Marjamäki
37ae4692bb
Uninitialized variables: fixed false negative when using uninitialized variable inside malloc call
2010-05-30 10:30:51 +02:00
Daniel Marjamäki
1ec49430e3
Uninitialized variables: better handling when uninitialized variables are used in function calls
2010-05-30 09:31:10 +02:00
Daniel Marjamäki
ab41879246
ExecutionPath: Better handling of 'FOREACH (..) {}'
2010-05-30 09:00:18 +02:00
Daniel Marjamäki
f41334e58a
ExecutionPath: better handling of 'FOREACH(..){..}'
2010-05-30 08:26:44 +02:00
Daniel Marjamäki
d3ed1c8960
Refactoring uninitialized variables (checking variable declarations)
2010-05-30 08:02:39 +02:00
Daniel Marjamäki
406cbda563
Uninitialized variables: better handling of struct variables
2010-05-30 07:55:11 +02:00
Daniel Marjamäki
46b5e4e79a
Fixed #1716 (Wrong reporting of leak with close() in a while loop condition)
2010-05-29 22:20:10 +02:00
Daniel Marjamäki
0c6352a826
Memory leaks: small fixes. add checking of 'g_fopen'. don't let 'fclose' calls be interpreted as 'callfunc'
2010-05-29 21:56:18 +02:00
Daniel Marjamäki
495dfde32c
Fixed #1716 (Wrong reporting of leak with close() in a while loop condition)
2010-05-29 21:11:59 +02:00
Daniel Marjamäki
24703418bd
Fixed #1715 (switch with fallthrough and 'return' confuses cppcheck)
2010-05-29 20:55:09 +02:00
Daniel Marjamäki
d09e1df0d7
Fixed #1714 (Wrong precedence for shift operators when simplifying calculations?)
2010-05-29 20:27:08 +02:00
Daniel Marjamäki
b702b8542d
Memory leaks: enabled the leaks checking when members are not deallocated in the destructor. This checking was previously an --all check so there could be false positives.
2010-05-29 19:29:59 +02:00
Daniel Marjamäki
7601089bee
astyle formatting
2010-05-29 11:19:56 +02:00
Daniel Marjamäki
82f030df2c
the virtual destructor error message needs to be restricted. marked the checking as inconclusive for now.
2010-05-29 11:19:28 +02:00
Zachary Blair
fe1fa4022d
Merge branch 'master' of github.com:danmar/cppcheck
2010-05-28 22:53:54 -07:00
Robert Reif
1a25183e8f
Fixed #1671 (simplifyTypedef: support for more typedefs)
2010-05-29 07:52:06 +02:00
Zachary Blair
59086fa599
Fixed #818 (Detect sprintf buffer overrun with struct members)
2010-05-28 22:51:28 -07:00
Robert Reif
3fb0260ef1
Fixed #1713 (remove Microsoft variants of inline)
2010-05-29 07:43:58 +02:00
Robert Reif
26a7d29760
Fixed #1671 (simplifyTypedef: support for more typedefs)
2010-05-28 06:55:54 +02:00
Daniel Marjamäki
d3c20cac81
Fixed #1712 (False negative: dereferencing uninitialized pointer)
2010-05-27 19:00:52 +02:00
Robert Reif
dc34a1b3ff
Fixed #1711 (Wrong typedef name shown when struct declared with __attribute__)
2010-05-27 18:15:42 +02:00
Robert Reif
8881a0c361
Fixed #1671 (simplifyTypedef: support for more typedefs)
2010-05-27 07:00:33 +02:00
Robert Reif
176b41caa5
Fixed #1709 (char buffer that is only accessed with pointers is marker not assigned)
2010-05-26 19:22:35 +02:00
Daniel Marjamäki
d23f63c805
astyle formatting
2010-05-26 19:21:34 +02:00
Daniel Marjamäki
88e9a4ade6
Fixed #1704 (false negative: null pointer dereference)
2010-05-26 19:16:42 +02:00
Zachary Blair
619cfbc56f
Fixed #168 (buffer overflow: not enough room for the null terminator)
2010-05-26 01:56:34 -07:00
Robert Reif
019e1f9dfe
Fixed #1671 (simplifyTypedef: support for more typedefs)
2010-05-25 20:43:44 +02:00
Robert Reif
4306082fcf
Fixed #1708 (False positive for const)
2010-05-25 06:55:49 +02:00
Daniel Marjamäki
5692e7a6f6
Fixed #1707 (false positive: Memory leak)
2010-05-24 19:28:27 +02:00
Daniel Marjamäki
c465d824b7
Removed TODO
2010-05-24 07:32:33 +02:00
Daniel Marjamäki
78255fdfc5
Tokenizer: Removed the Tokenizer::simplifyNamespaces. Ticket: #1700
2010-05-23 13:51:41 +02:00
Robert Reif
b20cf06b66
Fixed #1671 (simplifyTypedef: support for more typedefs)
2010-05-23 10:46:39 +02:00
Robert Reif
048733a15e
false positive: Variable is assigned a value that is never used
2010-05-23 10:41:05 +02:00
Daniel Marjamäki
8f76aea6ed
2 pass checking: broke out Cppcheck::analyseFile. To be used for tests
2010-05-21 21:06:11 +02:00
Daniel Marjamäki
75c9355e9a
Added some multipass checking for the uninitialized variables. It is still experimental. You can activate it with the '--test-2-pass' switch. Some more refactorings are needed to make it truly usable, the main thing is to make it thread safe.
2010-05-21 19:35:18 +02:00
Daniel Marjamäki
4633979ff7
fixed gcc compiler warnings (comparing float values)
2010-05-21 12:28:13 +02:00
Daniel Marjamäki
89ec49508d
Fixed gcc compiler warning
2010-05-21 12:13:05 +02:00
Robert Reif
a8921afcd7
Fixed #1698 (Add define support to GUI)
2010-05-21 09:49:57 +02:00
Daniel Marjamäki
8d2e4bc553
Tokenizer: give dead pointer a value
2010-05-21 08:26:53 +02:00
Robert Reif
78614b8dc1
Fixed #1699 (False positive: The function '...' can be const)
2010-05-20 17:45:10 +02:00
Robert Reif
5dfbb38dc9
#1697 (false positive: The function can be const)
2010-05-20 06:52:59 +02:00
Daniel Marjamäki
c31accc52a
Fixed #1695 (Ticket #1614 is broken using latest from git)
2010-05-19 19:23:09 +02:00
Daniel Marjamäki
6815f4e941
printchecks: better explanation of its purpose. I call it from gdb when I debug ExecutionPaths.
2010-05-18 20:58:11 +02:00
Daniel Marjamäki
1792395654
astyle formatting
2010-05-18 20:08:27 +02:00
Daniel Marjamäki
f87eb774eb
Fixed #1646 (False positive: array access after return cannot have default loop value)
2010-05-18 19:55:23 +02:00
firewave
2bced1d90c
Avoid some Visual Studio warnings
2010-05-18 19:19:15 +02:00
Robert Reif
41c43c1790
Fixed #1691 (False positive: Function parameter 'x' is passed by value. It could be passed by reference instead.)
2010-05-18 18:20:11 +02:00
Zachary Blair
1539c0b3d2
Fixed #1649 (add a warning for potential memory leaks when using realloc)
2010-05-17 22:46:48 -07:00
Robert Reif
0d7474042a
Fixed #1685 (segmentation fault of cppcheck)
2010-05-18 07:11:23 +02:00
Robert Reif
9dfbd3946a
Fixed #1673 (Tokenizer::simplifyTypedef causes segfault for boost library)
2010-05-17 19:58:27 +02:00
Daniel Marjamäki
f8442391af
astyle formatting
2010-05-17 19:51:35 +02:00
Daniel Marjamäki
453adb4ea4
Tokenizer: it is bad to do: 'tok->previous()->deleteThis()'
2010-05-17 19:50:36 +02:00
Monika Lukow
71e5c56bf9
Fixed #1418 (false negative: buffer access out of bounds)
2010-05-16 23:53:42 +02:00
Erik Lax
20289b1f5b
Fixed #1683 (false positive: The function can be const)
2010-05-16 20:26:32 +02:00
Daniel Marjamäki
56d176e1ce
Fixed #1684 (false positive: buffer access out of bounds when using extern variable declaration)
2010-05-16 20:21:22 +02:00
Daniel Marjamäki
4c6858fa9c
Refactoring: Removed 'possibleError'
2010-05-16 19:57:41 +02:00
Daniel Marjamäki
d0e122079f
Refactoring: Removed possibleError messages from CheckMemoryLeaks
2010-05-16 19:55:16 +02:00
Erik Lax
19aaa32a99
Fixed #1688 (Tokenizer::simplifyKnownVariables and pointer assignments)
2010-05-16 19:38:44 +02:00
Daniel Marjamäki
01034cd48d
Refactoring: Removed 'possible error' message about cin
2010-05-16 19:09:36 +02:00
Daniel Marjamäki
26fab24de4
Refactoring: Removed some inconclusive checking in CheckBufferOverrun
2010-05-16 15:30:39 +02:00
Daniel Marjamäki
6edb2e77b4
Refactoring: Removed Severity::possibleStyle
2010-05-16 14:43:42 +02:00
Daniel Marjamki
5fe2a56b41
doc: updated docs about -D command line flag
2010-05-16 08:48:03 +02:00
Daniel Marjamki
14b27f97fa
Fixed #1212 (Allow giving used defines in command line)
2010-05-16 07:38:29 +02:00
Daniel Marjamki
d7b117402c
Code cleanup: Removed autodealloc handling
2010-05-16 07:15:31 +02:00
Daniel Marjamki
8e3c39ae5b
Fixed #1678 (false positive: Member variable not initialized in the constructor, for arrays of undefined type)
2010-05-15 20:24:11 +02:00
Erik Lax
c0149d3cd1
Fixed #1679 (Bad iterators checks fails to detect bugs with indent levels)
2010-05-15 20:00:41 +02:00
Erik Lax
0510d9a2b0
Fixed #1680 (Bad iterators checks fail to detect invalidation of iterator for deletion by value)
2010-05-15 19:46:42 +02:00
Daniel Marjamki
70d20ac544
Fixed #1681 (false negative: memory leak in operator =)
2010-05-15 19:40:32 +02:00
Daniel Marjamki
972046c4bd
Added test CheckOther::sizeofsizeof. Inspired by #1682
2010-05-15 14:06:45 +02:00
Daniel Marjamki
85afa86da3
astyle formatting
2010-05-14 18:40:37 +02:00
Daniel Marjamki
8b1ffefd74
Fixed #1682 (Internal error)
2010-05-14 18:40:15 +02:00
Konrad Windszus
c39f80d361
Ticket #1318 : Make sure error ids are unique
2010-05-13 22:14:29 +02:00
Robert Reif
f8cceface5
Fixed #1677 (False positive: (style) Variable 'xxx' is assigned a value that is never used)
2010-05-13 13:59:41 +02:00
Martin Ettl
1382832bd0
mathlib:isInt() now handles calles of 'u' and 'l' correctly; testcases added
2010-05-12 23:49:09 +02:00
Robert Reif
963108d957
Fixed #1671 (simplifyTypedef: support for more typedefs)
2010-05-11 21:41:33 +02:00
Daniel Marjamäki
84c3ec9c4c
Fixed #1669 (Still seeing 'possible style' warnings in 1.43)
2010-05-10 21:22:59 +02:00
Daniel Marjamäki
5d01047ae4
Fixed #1665 ('If you see this, there is a bug': Token::Match('%var% ( %varid% [,)]', 0))
2010-05-10 18:11:02 +02:00
Robert Reif
a390f3c8f4
Better handling of function pointer typedef
2010-05-10 17:50:40 +02:00
Robert Reif
ac7515cdcc
Fixed #1666 (simplifyTypedef: add support for typedefs of functions)
2010-05-10 07:12:06 +02:00
Daniel Marjamäki
d7118c4d36
Fixed #1648 (mismatch allocate and deallocate calls.)
2010-05-09 13:46:13 +02:00
Daniel Marjamäki
7c52c8683d
Fixed #1662 (false positive: Data is allocated but not initialized, when using sprintf)
2010-05-09 07:48:52 +02:00
Robert Reif
be35b72c7e
Fixed #1660 (false positive: Variable is assigned a value that is never used, when using cast)
2010-05-09 07:15:40 +02:00
Daniel Marjamäki
8971d697b2
Fixed #1656 (dangerous usage of erase not detected: for (; it != it2; ++it) ints.erase(it);)
2010-05-08 20:11:15 +02:00
Daniel Marjamäki
2901434773
Fixed #1658 (false negative: uninitialized pointer usage)
2010-05-08 19:23:46 +02:00
Daniel Marjamäki
cdb6915a5b
cli help: show the flags in alphabetical order
2010-05-08 12:45:38 +02:00
Daniel Marjamäki
cbea8ceed0
Updated version to 1.43
2010-05-08 12:41:06 +02:00
Daniel Marjamäki
4e84ec0ff5
refactoring: spell checking comments
2010-05-08 10:39:45 +02:00
Daniel Marjamäki
bd22a18dc1
Refactoring: Changed 'possible style' to 'style'
2010-05-08 09:49:01 +02:00
Daniel Marjamäki
d19dd2c61d
Fixed #1654 (False positive: Memory leak with: ( delete ( p ) , ( p ) = 0 );)
2010-05-07 18:37:50 +02:00
Zachary Blair
21b7eb61f5
Fixed #959 : (new check: wrong usage of fflush()) Simplified and set severity to error
2010-05-06 23:08:10 -07:00
Daniel Marjamäki
c8c5f95721
Fixed #1651 (Tokenizer::setVarId wrong handling of return statement)
2010-05-06 18:40:52 +02:00
Daniel Marjamäki
af4c4cef34
Fixed #1646 (False positive: array access after return cannot have default loop value)
2010-05-05 18:29:56 +02:00
Robert Reif
4c95264d29
Fixed #1647 (False positive: buffer is not assigned value (assigned through alias))
2010-05-05 17:31:07 +02:00
Daniel Marjamäki
612be2557b
Fixed #1646 (False positive: array access after return cannot have default loop value)
2010-05-04 20:02:47 +02:00
Robert Reif
7ce70777a4
Fixed #1643 (Variable usage (pointer is assigned but never used))
2010-05-04 17:28:03 +02:00
Robert Reif
eb276346c5
Fixed #1639 (False positive: unused variable value (pointer aliasing))
2010-05-04 17:26:09 +02:00
Zachary Blair
707d27f3d8
Fixed #959 (new check: wrong usage of fflush())
2010-05-03 23:14:45 -07:00
Daniel Marjamäki
804b2a0952
Fixed #1642 (Tokenizer::simplifyKnownVariables: simplify after loop)
2010-05-02 14:41:21 +02:00
Daniel Marjamäki
0415560912
refactoring: changed the severity for strncatUsage from possibleError to style
2010-05-02 09:54:08 +02:00
Daniel Marjamäki
883d462553
refactoring: Use style severity instead of possible error for the 'The size argument is given as a char constant'
2010-05-02 09:16:45 +02:00
Daniel Marjamäki
136b84eaf5
STL: added testcase for 'if (str.find(%any%)) ..'
2010-05-01 21:56:39 +02:00
Daniel Marjamäki
ae576be088
refactoring: enable the 'suspicious pointer subtraction' checking
2010-05-01 21:43:47 +02:00
Robert Reif
6eb16e0f16
Fixed #1640 (False negative: Unused value (variable is assigned but never read))
2010-05-01 21:15:14 +02:00
Daniel Marjamäki
58e26ab1fc
Fixed Cppcheck warning about possible null pointer dereference
2010-05-01 11:55:26 +02:00
Slava Semushin
f50d182750
Fixed #1574 (chain assignments could be simplified)
...
http://sourceforge.net/apps/trac/cppcheck/ticket/1574
2010-05-01 15:28:35 +07:00
Daniel Marjamäki
080374dc04
Fixed #1638 (Tokenizer::simplifyKnownVariables: removing variable declaration)
2010-05-01 10:09:53 +02:00
Robert Reif
4014bd234f
Unit testing: Improved test coverage for variable usage checking
2010-05-01 09:26:47 +02:00
Robert Reif
1fa1ff8d14
Fixed #1636 (Fix false positive with strncpy termination check)
2010-04-30 21:36:48 +02:00
Robert Reif
5738f34872
Fixed #1622 (False positive: buf is not assigned a value (pointer aliasing))
2010-04-30 18:11:51 +02:00
Eric Sesterhenn
344b6bf434
Fixed #1636 (Fix false positive with strncpy termination check)
2010-04-30 18:08:32 +02:00
Eric Sesterhenn
b261e5df25
Fixed #1634 (Null character not correctly tokenized)
2010-04-29 18:30:23 +02:00
Robert Reif
c79b9a8aac
Fixed #1631 (Tokenizer: remove register keyword)
2010-04-29 07:17:38 +02:00
Robert Reif
70d475f8c2
Fixed #1622 (False positive: buf is not assigned a value (pointer aliasing))
2010-04-29 07:10:50 +02:00
Daniel Marjamäki
cccccff96f
Fixed #1629 (False negative: null pointer derefence not detected 'c[0] = 0')
2010-04-28 22:07:39 +02:00
Daniel Marjamäki
2666aad207
Fixed #1632 (false positive: unintialized variable)
2010-04-28 21:33:11 +02:00
Daniel Marjamäki
d3b5c30c6c
Fixed #1628 (false negative: memory leak when using redundant braces)
2010-04-27 20:43:31 +02:00
Robert Reif
f0018100e1
Variable usage: Use variable id instead of variable name to identify variable
2010-04-27 05:05:32 +02:00
Daniel Marjamäki
9430089532
Fixed #1626 ('Unusual pointer arithmetic' false positive)
2010-04-26 21:43:01 +02:00
Daniel Marjamäki
0444ff5298
Fixed #1627 (###### If you see this, there is a bug ###### - Token::Match('%varid% [ %num% ]', 0))
2010-04-26 18:52:40 +02:00
Daniel Marjamäki
6bb93b5eb7
Fixed #943 (Tokenizer: improve handling of pointer aliasing)
2010-04-25 15:12:47 +02:00
Daniel Marjamäki
cda6fdb73d
astyle formatting
2010-04-25 14:56:04 +02:00
Martin Ettl
ec935178fc
reduced compiler warning of gcc-4.4 about initialization order in Ctor list of executionpath.h
2010-04-25 13:14:58 +02:00
firewave
52b84963e6
Fixed Access Violation with --enable=style when no tokens exist
2010-04-25 12:35:09 +02:00
firewave
f1d1d60924
Added missing include
2010-04-25 12:10:50 +02:00
Daniel Marjamäki
eb82a89758
ExecutionPath: Better handling of if
2010-04-25 11:55:57 +02:00
Daniel Marjamäki
1a34e7daf6
Fixed #948 (array index out of bound not detected 'a[i-1] = 0')
2010-04-25 07:34:50 +02:00
Daniel Marjamäki
e068979d62
Fixed #1440 (false negative: memory leak (function parameters))
2010-04-24 22:24:03 +02:00
Daniel Marjamäki
8ccd95a643
Fixed #836 (buffer overrun: memmove)
2010-04-24 21:48:58 +02:00
Daniel Marjamäki
5e5b8d3861
Fixed #1146 (improve check: memory leak not detected (allocation in subfunction))
2010-04-24 20:40:57 +02:00
Daniel Marjamäki
5b99f2cef1
--errorlist : don't show inconclusive messages in the output because those are disabled
2010-04-24 19:40:48 +02:00
Daniel Marjamäki
a15e25f9fe
Fixed #1571 ('C-style pointer casting' should not be reported for C files)
2010-04-24 16:46:09 +02:00
Daniel Marjamäki
6b52730d4e
Fixed #1616 (false positive - Upon exception there is a memory leak)
2010-04-24 14:51:10 +02:00
Daniel Marjamäki
f3bea249ac
Removed the check for unreachable code. The g++ warning -Wunreachable-code is recommended instead. This closes #1603 (break after a return or goto should not be an error in a switch statement).
2010-04-24 14:30:45 +02:00
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