Daniel Marjamäki
848fd59cbd
Fixed #3913 (boundcheck, false positive continue in loop)
2012-07-08 14:34:47 +02:00
Daniel Marjamäki
bf98e952c1
Fixed #3927 (false positive: (error) Uninitialized variable: new)
2012-07-08 13:59:00 +02:00
PKEuS
f5f63dc4a6
Message refactorization: check64bit.cpp
...
Added two articles in checkautovariables.cpp as suggested by kimmov
2012-07-08 02:38:58 -07:00
PKEuS
0f1cb4c98c
Message refactorization: checkassignif.cpp, checkautovariables.cpp
2012-07-07 11:31:18 -07:00
Daniel Marjamäki
49198f52c4
Fixed #3934 (False positive for logical conjunction with enum and define)
2012-07-07 15:34:26 +02:00
PKEuS
d3c44c20ff
Refactorized checking of scanf field width specifiers ( #3946 ):
...
- Removed duplicate check
- Changed severity to portability, when a crash only happens with certain libc versions
- Fixed handling of * in format string (#3877 )
- Added support for [...] pattern
- Removed garbage from tests
2012-07-07 04:34:37 -07:00
PKEuS
dec4844c10
Define _WIN64 in VS10 solution when compiling for x64
2012-07-07 02:41:41 -07:00
PKEuS
2c9545f603
Fixed #3797 : _ is a valid character in suppression IDs
2012-07-06 09:16:43 -07:00
PKEuS
5caab6ba10
Fixed crash on garbage code ( #3870 )
2012-07-06 09:03:33 -07:00
Daniel Marjamäki
543ccdd4c0
Removed simplifyEnum timer that I didn't intend to include in the previous commit.
2012-07-06 15:48:51 +02:00
Daniel Marjamäki
6ad5fc8456
Refactoring Tokenizer::simplifyEnum. The enum handling is now somewhat faster since all enum values of a enum are simplified at the same time.
2012-07-06 15:43:50 +02:00
Edoardo Prezioso
3c4ce7b43a
Fixed (for real) the preprocessor.cpp(1166) warning in #2123 .
2012-07-06 13:17:08 +02:00
Daniel Marjamäki
f9da83f4b5
Fixed #3926 (false postive: (error) Uninitialized variable: exitpattern)
2012-07-03 18:52:23 +02:00
Robert Morin
25c1cc4c8e
Improve check: warn when comparing boolean value with < <= > >=. Ticket: #2617
2012-07-03 06:39:13 +02:00
Thomas Sondergaard
f72ddbb2e9
Fixed #3912 (Analysis failed)
2012-07-03 06:34:14 +02:00
PKEuS
2de6ea4627
Incremented version to "1.56 dev"
2012-07-02 11:10:07 -07:00
Edoardo Prezioso
fa24fff3dc
Fixed the warning with GCC 4.7.1:
...
cast from type ‘const void*’ to type ‘const char**’ casts away qualifiers.
2012-07-02 19:37:30 +02:00
Daniel Marjamäki
2536746d02
1.55: Set version
2012-06-30 18:08:27 +02:00
Daniel Marjamäki
9716c059f5
updated --doc output
2012-06-30 17:44:05 +02:00
Daniel Marjamäki
7312885c87
updated --doc output from CheckLeakAutoVar
2012-06-30 16:30:56 +02:00
Daniel Marjamäki
325414e354
CheckLeakAutoVar: Updated error messages
2012-06-30 16:23:10 +02:00
Daniel Marjamäki
bb9f114d84
Fixed #3924 (False positive: Uninitialized variable (const pointer))
2012-06-30 12:12:36 +02:00
Daniel Marjamäki
cb7757f650
CheckUnusedVar: dont report false positives for extern variables
2012-06-28 17:22:56 +02:00
Daniel Marjamäki
2e3a08a8c1
Fixed #3916 (false positive: uninitialized variable when using assignment and , in rhs)
2012-06-27 20:44:19 +02:00
Daniel Marjamäki
9da3373876
Fixed #3919 (False positive: uninitialized variable (extern))
2012-06-26 18:28:41 +02:00
Edoardo Prezioso
1ad56a25c6
Fixed the preprocessor.cpp(1166) warning in #2123 .
2012-06-26 12:28:52 +02:00
Daniel Marjamäki
0042ee7bc8
Fixed #3660 (False positive memleak (allocation function uses non-local variable))
2012-06-25 20:00:50 +02:00
PKEuS
f5c42660de
Fixed #3909 : Handle constructor syntax initialization.
2012-06-24 09:57:17 -07:00
Daniel Marjamäki
25b24d149f
Fixed #3910 (False positive: Variable is not assigned a value (pointerArray alias))
2012-06-24 16:54:37 +02:00
Daniel Marjamäki
be464b43b3
Memory leaks: updated configuration handling. it's still not auto-tested.
2012-06-24 15:38:37 +02:00
Daniel Marjamäki
8af044255d
Tokenizer: Added new function isFunctionParameterPassedByValue that check if a parameter is passed by value
2012-06-24 13:40:09 +02:00
Daniel Marjamäki
72d24ab4b4
Fixed #3904 (false positive memory leak with linked list)
2012-06-23 20:15:58 +02:00
Daniel Marjamäki
162a430354
Fixed #3868 (false positive: (style) Same expression on both sides of '|'.)
2012-06-23 19:54:15 +02:00
Daniel Marjamäki
b6f4dbd067
Uninitialized variables: Fixed TODO assertion (related with ticket #3106 )
2012-06-23 16:06:20 +02:00
Daniel Marjamäki
7f5950967e
Reviewed handling of >> in return statements in C files in UninitVar checking
2012-06-23 15:47:48 +02:00
Daniel Marjamäki
f0f69ed818
Reviewed handling of << and >> in C files in CheckUninitVar
2012-06-23 12:41:00 +02:00
Daniel Marjamäki
e2964c0c9e
Uninitialized variables: Fixed false negative when ? operator is used in rhs
2012-06-23 12:19:03 +02:00
Daniel Marjamäki
a15dac9285
simple spell checking 'itis' => 'it is'
2012-06-23 10:08:18 +02:00
Daniel Marjamäki
5de82c1c42
Updated arrayIndexOutOfBounds error message. Thank you Kimmo for the suggestion.
2012-06-23 09:51:32 +02:00
Daniel Marjamäki
4e98cb3ed9
Fixed #3907 (improve check: detect buffer overrun when using && or || in for loop)
2012-06-23 09:23:14 +02:00
Daniel Marjamäki
ac524c56ad
Reviewed handling of unknown types in ExecutionPathBufferOverrun
2012-06-23 08:15:59 +02:00
Robert Reif
dc4982115a
Improved checking of scanf format strings
2012-06-23 07:52:52 +02:00
Daniel Marjamäki
3db58bb57f
Reviewed C handling in CheckOther::clarifyCondition, never treat x<..> as a template in C files.
2012-06-23 07:29:49 +02:00
Daniel Marjamäki
d2dbaca24b
Reviewed handling of unknown types in C files in UninitVar
2012-06-22 19:57:07 +02:00
Daniel Marjamäki
abaa044e03
Reviewed handling of unknown types in CheckUninitVar
2012-06-22 16:39:39 +02:00
Daniel Marjamäki
354406441a
Fixed #3906 (false positive uninitvar for vector pointer)
2012-06-22 16:26:43 +02:00
Daniel Marjamäki
951da02f89
Reviewed handling of unknown types in C files in checkunusedvar
2012-06-22 15:59:41 +02:00
Daniel Marjamäki
8aba801360
Fixed #3800 (False negative: Self-assignement of variable declared as 'extern')
2012-06-22 11:23:50 +02:00
Daniel Marjamäki
d6e2e867ea
refactoring CheckAutoVariables
2012-06-22 11:21:51 +02:00
Daniel Marjamäki
935351c601
Fixed #3895 (Improve check: double deallocation not detected (if-else))
2012-06-22 09:10:30 +02:00
Daniel Marjamäki
195174b69f
astyle formatting
2012-06-21 19:05:14 +02:00
Daniel Marjamäki
edea4ef131
Refactoring: Renamed CheckNullPointer::isPointer to Token::isUpperCaseName
2012-06-21 19:00:53 +02:00
Daniel Marjamäki
956a37a382
Fixed compiler errors
2012-06-20 17:39:31 +02:00
Daniel Marjamäki
3d0e090a13
Fixed #3899 (false positive: (error) Returning/using deallocated pointer fp)
2012-06-20 17:09:41 +02:00
Daniel Marjamäki
180bb00ac6
Merge pull request #74 from kimmov/errorlogger
...
Refactoring information messages.
2012-06-19 11:19:59 -07:00
Daniel Marjamäki
974225626d
Fixed #3901 (false positive: (error) Uninitialized variable: temp)
2012-06-19 20:07:39 +02:00
Daniel Marjamäki
ce5c38f52c
Fixed #3890 (False positive Uninitialized variable on returning default value on a class member)
2012-06-19 20:04:10 +02:00
Kimmo Varis
68c52ddd69
Refactoring information messages.
...
Currently the information severity messages are outputted as error
messages with Severity::Information. This causes constant confusion
as people think it as mildest error severity (and rightfully so).
When it was meant to be for printing messages about the checking
procedure itself (like missing header files etc).
So I'm adding a new function for the ErrorLogger for printing these
informative messages. This makes clear the distinction of errors
found from the code and messages related to the checking itself.
It also makes it easier for clients to handle these separately.
2012-06-19 00:16:20 +03:00
Edoardo Prezioso
57ade25099
Fixed checkio.cpp warning in #2123 .
2012-06-18 13:08:01 +02:00
Daniel Marjamäki
2f280332ef
Merge pull request #99 from kimmov/tests-generate-pri
...
Generate a test file listing with dmake.
2012-06-17 10:49:42 -07:00
Daniel Marjamäki
a37c3144ed
Fixed #3858 (Throw exception in destructor BUT inside a try-catch shouldn't be reported)
2012-06-17 14:33:18 +02:00
Daniel Marjamäki
62f92fe253
Fixed #3866 (false positive: memory leak (UNLIKELY))
2012-06-17 07:54:24 +02:00
Daniel Marjamäki
2481b80875
Code cleanup. Removed CheckLeakAutoVar::doubleDeallocationError since the same checking is already done by CheckOther::checkDoubleFree
2012-06-17 07:22:15 +02:00
Zachary Blair
fa2bca1e09
Ticket #3876 : Improved check by only bailing of loops that contain break or continue
2012-06-16 13:11:09 -07:00
Daniel Marjamäki
2c6c61fb0d
Merge pull request #101 from simartin/clang_warn_fix
...
Get rid of a warning
2012-06-16 08:48:02 -07:00
Daniel Marjamäki
7d59d86ed6
Fixed #3893 (Improve check: Array index out of bounds not detected when down conting)
2012-06-16 17:44:51 +02:00
Simon Martin
459369e3b9
Get rid of a warning
2012-06-16 06:34:18 +02:00
Daniel Marjamäki
89b1b4ea6e
Fixed #3892 (False positive: 'if (var >= 0.0) then if (var >= 0.0) always returns true
2012-06-15 16:54:02 +02:00
Daniel Marjamäki
f967142436
Fixed #3875 (Static member method called with class name is considered unused)
2012-06-14 22:04:21 +02:00
Daniel Marjamäki
5174f7ff5e
Fixed #3723 (Preprocessor evaluation order)
2012-06-14 21:47:03 +02:00
PKEuS
8b294a2d4f
Disabled C4512 in VS10 ( #3882 )
2012-06-14 09:39:31 -07:00
PKEuS
1a6e69a80b
Fix for problem: "Too many #ifdef configurations - cppcheck will only check 12 of 12"
2012-06-13 10:50:50 -07:00
Daniel Marjamäki
4b6e1c6946
Fixed #3855 (false positive: (error) Instance of 'locale' object destroyed immediately)
2012-06-13 19:21:20 +02:00
Daniel Marjamäki
cc5e06b5d2
Fixed #3861 (uninitialized variables)
2012-06-13 19:09:51 +02:00
August Sodora
90f92250dd
Fixed #3618 (segmentation fault of cppcheck)
2012-06-12 21:07:17 +02:00
Daniel Marjamäki
54a66391d8
Fixed #3750 (false positive: C-style pointer casting)
2012-06-12 18:45:31 +02:00
Kimmo Varis
db587794c9
Update Makefile.
2012-06-11 22:16:12 +03:00
Daniel Marjamäki
08a3d0737e
Memory leaks: Write error message when deallocated pointer is returned
2012-06-11 18:28:31 +02:00
Zachary Blair
e2348560e4
Fixed Ticket #3876 (Error (double free) detected that can't possibly happen)
2012-06-10 17:50:31 -07:00
seb777
5b763a9f0a
Fixed #3579 (object destroyed immediately:False positive & negative)
2012-06-10 21:52:32 +02:00
PKEuS
4b80e91145
Implemented support for building cppcheck lib into a dll
...
Updated VS9 solution
New VS10 solution that builds cppcheck into a dll used by cli and testrunner.
Functional changes and advantages of new solution:
- Share code between testrunner and cli; ability to share code with gui as well (not yet implemented)
- Files of /lib are no longer compiled twice (should improve build time on single core machines)
- Added configuration for building with PCRE support
- Executables are build into /bin (/bin/debug in debug mode) folder (Should no longer require rebuild when switching between debug and release)
- Completely x64 compatible (contains also x64-debug configuration now)
2012-06-10 05:19:09 -07:00
Daniel Marjamäki
171f570639
Handle UTF-16 files. Partial fix for ticket #2083
2012-06-10 11:00:27 +02:00
Daniel Marjamäki
905615e991
Fixed #3878 (Sign extension with unsigned char false positive)
2012-06-09 08:43:13 +02:00
PKEuS
e191f0d7d4
Fixed test failures in testio caused by my last commit.
2012-06-08 10:35:08 -07:00
PKEuS
c463d97386
Refactorization:
...
- Implemented consistent behaviour of Variable::typeStartToken/typeEndToken: Skip const and static on all variables.
- Simplified patterns containing "static|" or "const|" when matching typeStartToken.
2012-06-08 09:05:02 -07:00
Daniel Marjamäki
69846b2a06
Fixed #3872 ('char variables in bit operations' warning)
2012-06-08 17:24:54 +02:00
Daniel Marjamäki
c5da030674
Fixed #3869 (References to items in array result it 'Uninitialized variable' errors)
2012-06-08 16:17:55 +02:00
Daniel Marjamäki
2b3e5abef8
Fixed #3865 (Suspicious condition. The result of find is an iterator, but it is not properly checked.)
2012-06-07 19:33:18 +02:00
PKEuS
7c1b0a7602
Issue useInitializationList message only on variables of class types.
2012-06-06 03:03:51 -07:00
Daniel Marjamäki
3c103e520b
Fixed #3854 (false positive: (style) Variable '_S_c_name' is assigned a value that is never used)
2012-06-05 06:37:55 +02:00
August Sodora
e146591b5d
Fixed #3544 (segmentation fault of cppcheck)
2012-06-02 16:15:12 +02:00
Daniel Marjamäki
0cf2c2b327
Fixed #3862 (Double deallocation does not take throws into account)
2012-06-01 19:08:50 +02:00
Daniel Marjamäki
a823d29da3
Fixed #3809 (false positive: memory leak)
2012-06-01 19:01:19 +02:00
Daniel Marjamäki
d1b4bea304
Fixed #3807 (False positive: possible null pointer dereference)
2012-05-31 18:41:00 +02:00
Daniel Marjamäki
cad2e80897
Memory leak: Fixed unit tests that were broken by mistake by my previous commit
2012-05-30 06:43:30 +02:00
Daniel Marjamäki
27003e72b8
Memory leak: minor updates of new leak checking. fixed condition in parseConfiguration. write info message if configuration has been given.
2012-05-30 06:36:59 +02:00
Daniel Marjamäki
2e41510e30
Fixed #3806 (Possible leak in public function. The pointer '' is not deallocated before it is allocated)
2012-05-29 21:13:34 +02:00
Daniel Marjamäki
8d0f315097
Fixed #3851 (False positive memory leak (condition))
2012-05-29 21:10:19 +02:00
Zachary Blair
2bd171dded
Fixed #3794 (New check: Missing break in switch (duplicate bitwise operation))
2012-05-28 21:19:22 -07:00
Daniel Marjamäki
9b2d60bf42
Merge pull request #97 from simartin/clang_warn_fix
...
Get rid of a warning
2012-05-26 12:37:04 -07:00
Daniel Marjamäki
92c5cffeb0
Memory leaks: Fixed false positive when allocated pointer is assigned
2012-05-26 21:28:35 +02:00
Daniel Marjamäki
b8b16172b8
Memory leaks: Added support for a simple configuration file format. This is not supposed to become the official configuration format, it's just a temporary format that we can use to start with.
2012-05-26 18:10:12 +02:00
Simon Martin
cede3fc805
Get rid of a warning
2012-05-26 15:49:40 +02:00
Daniel Marjamäki
bd8fb0a6b5
Memory leaks: Added new checking for memory leaks
2012-05-26 08:53:46 +02:00
PKEuS
f4bf94ca4f
Fixed #3845
2012-05-25 07:28:32 -07:00
PKEuS
79445e52ad
Refactorized CheckUninitVar to use SymbolDatabase
2012-05-25 04:40:18 -07:00
PKEuS
9dc8123151
Refactorizations:
...
- Use const string references instead of const strings copies when possible
- Fixed cppcheck warning about postfix increment in CheckIO
- Use symbolDatabase to detect pointers in CheckOther::checkAssignBoolToPointer
2012-05-25 03:09:41 -07:00
PKEuS
e2bab4b6a3
Implemented Function::nestedIn to be able to identify the scope the function belongs to, even if Function::functionScope.functionOf is not available.
...
Refactorized usage of SymbolDatabase in checkOther:
- Don't copy Function instances in checkExpressionRange
- Simplifications by more accurate usage of information in database
2012-05-24 08:40:43 -07:00
PKEuS
97c4af44ca
Refactorizations in checkOther:
...
- More accurate usage of symbolDatabase to reduce code and false negatives
- Avoided unnecessary construction of pattern string
- Only search for class/struct definition before usage
2012-05-24 06:34:59 -07:00
PKEuS
334fc16f29
Refactorized CheckOther::checkSizeofForArrayParameter: Use symboldatabase to detect arrays.
2012-05-24 00:39:16 -07:00
PKEuS
9ca7f6a8c3
Fixed crashes #3830 and #3832
2012-05-23 01:04:21 -07:00
PKEuS
dc64ac2918
Removed unnecessary variable Function::start - The value is already stored in Function::functionScope->classStart.
2012-05-22 12:58:46 -07:00
PKEuS
26f5f08614
Initialize Function::start when the function is implemented, not when its defined. ( Fixes #3826 )
2012-05-22 12:30:10 -07:00
Daniel Marjamäki
77e9106ec0
Fixed #3634 (False positive: compareBoolExpressionWithInt when using boost::tuples)
2012-05-22 19:01:21 +02:00
Daniel Marjamäki
5b0551054a
varid: better templates handling
2012-05-22 18:58:13 +02:00
Ettl Martin
1fd6d36493
fixed regression with g++-4.6 (Ubuntu Linux, 64 Bit). Moved local struct definition out of function scope. No functional change.
2012-05-22 15:43:40 +02:00
PKEuS
a8382ea553
Implemented file pointer usage checking:
...
- File I/O without positioning function call (#1742 )
- Read/Write to a file that was opened for writing/reading (#463 )
- Operations on closed file
Old fflushOnInputStream check is now part of the new check.
2012-05-22 05:30:22 -07:00
PKEuS
f3f46b4861
Fixed #3820
2012-05-22 02:27:21 -07:00
PKEuS
f5ef6f255e
Hande try and do in initialization list usage check ( #3823 )
2012-05-22 01:35:56 -07:00
PKEuS
e8dfe2407a
Fixed crash in Variable::evaluate ( #3825 )
2012-05-22 01:29:33 -07:00
Andy Maloney
e344653e90
Remove extra semicolon
2012-05-20 11:40:39 -04:00
Daniel Marjamäki
aebedfb123
dmake: updated Makefiles
2012-05-20 12:04:47 +02:00
PKEuS
b81eafe0dc
Splitted CheckIO from CheckOther.
2012-05-20 02:57:07 -07:00
Edoardo Prezioso
892c125ff8
Fixed: lib/checkclass.cpp:538:85: warning: declaration of ‘name’ shadows a member of 'this'.
2012-05-19 21:51:39 +02:00
PKEuS
be7b104a8e
Added missing checks to CheckClass::classInfo()
...
Replaced tokAt(1) with next() in checkother.cpp
2012-05-19 01:51:47 -07:00
Andy Maloney
4686294d7e
Fix compiler warning about empty for body
2012-05-18 14:00:10 -04:00
Andy Maloney
12c5980c01
Fix compiler warning about initialization order
2012-05-18 13:59:19 -04:00
PKEuS
de79a4c84f
Fixed initialization list usage according to cppcheck results
...
Fixed comments mentioning nonexistent parameters
2012-05-18 07:57:11 -07:00
PKEuS
e77f348d82
New check: Suggest to use initialization list instead of assignment in constructor. ( #489 )
2012-05-18 07:54:58 -07:00
PKEuS
77927583f4
Fixed two compiler warnings spotted by edward-san (one of them was a real bug)
2012-05-17 08:29:32 -07:00
PKEuS
a9cfe2814a
Made some functions const according to cppcheck results
2012-05-17 02:54:17 -07:00
PKEuS
4825f78663
Fixed #2477 and #2669
2012-05-17 02:15:21 -07:00
PKEuS
3f5712bfb8
Fixed false positive "Function can be const" when 'this' is passed to a Memberfunction
2012-05-17 01:49:52 -07:00
PKEuS
4bb2a1b27b
Made some functions static or const according to cppcheck results
2012-05-17 01:33:24 -07:00
PKEuS
ea601ef2b0
Fixed false positives about const correctness caused by incorrect handling of default arguments
2012-05-17 01:05:36 -07:00
Daniel Marjamäki
f803a18d50
Fixed #3749 (false positive: same expression on both sides of operator)
2012-05-17 07:26:57 +02:00
Daniel Marjamäki
505aa6e4cc
TestSimplifyTokens::enum29: Fixed crash
2012-05-16 21:39:26 +02:00
PKEuS
6a05ad1cf8
Improved fix for #2698 and added test case
2012-05-16 12:36:05 -07:00
PKEuS
77df633904
Improved handling of function calls in const correctness check: Fixed #2702 , #2698 , #2729 .
2012-05-16 11:57:12 -07:00
Daniel Marjamäki
0bb0fdedc2
Fixed #3747 (False 'boolean result in bitwise' message with 'mask' enums)
2012-05-16 18:48:33 +02:00
Edoardo Prezioso
573256350a
Fixed: mathlib.cpp(258): warning C4702: unreachable code.
2012-05-16 15:26:03 +02:00
PKEuS
279b0c59bb
Don't set Preprocessor::missingIncludeFlag if missingInclude warning is suppressed ( #3487 ).
2012-05-16 02:59:45 -07:00
PKEuS
0157f937bf
Fixed #3760 : Added explicit to C++ keyword list in setVarId
...
Made some constant arrays static
2012-05-16 01:59:52 -07:00
PKEuS
e8cd119ebd
Improved parsing of functions that accept nullpointers but no uninitialized data ( Fixed #3811 )
2012-05-16 00:56:39 -07:00
PKEuS
132a95b5f2
Fixed bug in symboldatabase: Don't ignore const or static on variables declared that are declared with both keywords. ( Fixes #3805 )
2012-05-15 12:03:43 -07:00
Daniel Marjamäki
4ae8e4f382
Tokenizer::setVarId: Minor fix of sizeof handling
2012-05-15 18:40:24 +02:00
Daniel Marjamäki
a0e5fad6a9
Fixed #3776 (Tokenizer::setVarId: No varid set when unknown macro is used before variable declaration)
2012-05-15 07:17:31 +02:00
PKEuS
42fd19fb37
Refactorization in checkclass.cpp:
...
- Improved handling of pointers and constants in constructor checking (-> Fixed #3801 )
2012-05-14 12:50:23 -07:00
PKEuS
1dee3b04b9
Bugfixes in SymbolDatabase:
...
- Constant pointers are now detected as variable declarations
- Probably fixed #3802
2012-05-14 12:47:02 -07:00
Edoardo Prezioso
eacf74be8d
Changed the order of some structures in order to improve, even if for a bit, their padding.
2012-05-14 20:49:03 +02:00