Daniel Marjamäki
2a0716449f
Fixed #5498 (C++0x11 default values for class fields and missing constructor)
2014-03-24 06:15:51 +01:00
Daniel Marjamäki
dbc8273cb7
ValueFlow: improved abstract interpretation of for loops
2014-03-24 00:16:02 +01:00
Daniel Marjamäki
c14a3d67bb
ValueFlow: Handle division by zero better in abstract interpretation
2014-03-23 20:37:56 +01:00
PKEuS
1be7bfa7fe
Fixed crash on invalid code ( #5603 )
2014-03-23 20:08:16 +01:00
Daniel Marjamäki
30fa187b30
Fixed #5549 (ValueFlow: Handle static variables better in valueFlowAfterAssign)
2014-03-23 17:57:27 +01:00
PKEuS
5f2067e401
Refactorized dead code elimination:
...
- Use library to get noreturn functions
- Fixed do-while simplification (#4940 )
2014-03-23 10:59:41 +01:00
PKEuS
77c17100ec
Bailout in private function usage checking for operators ( #5059 ).
2014-03-23 10:06:14 +01:00
PKEuS
8d5be8c4a4
Fixed related issues to #5601
2014-03-22 22:35:20 +01:00
PKEuS
58c2f372b9
Fixed false positive when noreturn function is defined ( #5601 , second attempt)
2014-03-22 19:55:13 +01:00
PKEuS
6395cb9b95
Syntax error on invalid enum ( #5600 )
2014-03-22 19:31:01 +01:00
Daniel Marjamäki
b6276058da
Value Flow: Improved abstract interpretation of arithmetical expressions
2014-03-22 19:02:33 +01:00
PKEuS
77c871035b
Fixed false positive when noreturn function is defined ( #5601 )
2014-03-22 18:57:19 +01:00
Daniel Marjamäki
7d2357de8d
Refactoring. Use astIsFloat()
2014-03-22 18:42:29 +01:00
PKEuS
560cf397d3
Fixed C++11 right angle bracket issue #5150
2014-03-22 13:34:15 +01:00
Alexander Mai
6a08c27183
Fix segfault in variableIsUsedInScope() - loop variable not check against NULL
2014-03-22 11:14:11 +01:00
Alexander Mai
e1c565357a
Invalid code cause SIGSEGV since loop variable tok2 was not checked properly
2014-03-22 10:32:24 +01:00
Alexander Mai
37befc75ef
In case of a loop within the class hierarchie Function::isImplicitlyVirtual_rec() was entering an endless loop. Tracking the previously analyzed types shall prevent this.
2014-03-22 08:49:28 +01:00
Martin Ettl
e00f50b850
Fixed #5597 and added abort() support to stdcfg.
2014-03-21 17:36:48 +01:00
PKEuS
49b25b05d9
Fixed crash in CheckBufferOverrun on garbage code ( #5595 )
2014-03-21 13:20:44 +01:00
orbitcowboy
6507824a34
Added support for putchar() to std.cfg.
2014-03-20 05:49:38 +01:00
orbitcowboy
80e3b49cfc
Added support for ftell() and puts() to std.cfg.
2014-03-20 04:10:41 +01:00
Daniel Marjamäki
fc014f055f
ValueFlow: Removed wrong bailout
2014-03-21 08:33:45 +01:00
orbitcowboy
30006cf06f
Added support for fputs() to std.cfg.
2014-03-20 02:13:41 +01:00
Daniel Marjamäki
54e7f34f4a
Fixed #5584 (FP: Division by zero when function not declared)
2014-03-20 16:12:58 +01:00
orbitcowboy
b37e9601c1
Added support for fgetc() to std.cfg.
2014-03-20 00:59:52 +01:00
Daniel Marjamäki
8de4246713
Uninitialized variables: Improved handling of function calls when struct members are checked
2014-03-20 06:48:17 +01:00
Martin Ettl
fe1b46c174
Extended std.cfg
2014-03-19 21:08:48 +01:00
Robert Reif
5c88934431
CheckIo: Fixed FIXME
2014-03-19 20:57:33 +01:00
Daniel Marjamäki
d939aa63a6
Tokenizer: Added test case for fixed crash to prevent regressions later
2014-03-19 16:47:11 +01:00
Robert Reif
806ef44509
Fixed #5328 (Does not handle __attribute((xxx)) in typedefs)
2014-03-19 05:38:23 +01:00
Daniel Marjamäki
01c29ed15f
Fixed #5518 (FP regression in 1.64: Array accessed out of bounds)
2014-03-18 17:04:33 +01:00
PKEuS
a3f5beb75d
Fixed problems with code "enum class { };" (which is valid C)
2014-03-18 16:23:30 +01:00
XhmikosR
fc54e6acc4
Trim tailing spaces and convert tabs to spaces.
2014-03-18 17:00:28 +02:00
PKEuS
3a4b7e5c07
Fixed false positive #5578
2014-03-18 13:44:27 +01:00
PKEuS
af161fc361
Rewrote CheckStl::readingEmptyStlContainer(), resolving all its false positives shown on CppChecks own code
2014-03-18 12:38:22 +01:00
Daniel Marjamäki
177bf6fcb3
Fixed #5244 (FP: (error) Uninitialized variable: ptr - initialization within if-clause)
2014-03-18 06:37:19 +01:00
Robert Reif
7b5a96dc06
Partial fix for #5536 (printf/scanf argument tests failing on Windows x64)
2014-03-18 06:12:09 +01:00
Daniel Marjamäki
e240282443
Value Flow: Another try with the abstract interpretation of for loops
2014-03-17 18:43:47 +01:00
PKEuS
2568baa473
#5528 : Raise duplicateExpressionError on operators /, % and -.
2014-03-17 18:35:36 +01:00
PKEuS
fab6b56360
Improved check ( #5553 ): Detect stricmp(var.c_str(), var.c_str())
2014-03-17 17:41:45 +01:00
PKEuS
5f67bc1b0a
Fixed varId problem #5293 (and its duplicate #5577 ): Classes inside functions are non-executable scopes.
2014-03-17 16:15:42 +01:00
Daniel Marjamäki
06618b31bb
Fixed #5574 (False positive: mismatchAllocDealloc using realloc() and free)
2014-03-17 16:10:54 +01:00
PKEuS
521734faa2
Fixed setVarId-Bugs #5294 and #5295 .
2014-03-17 14:19:46 +01:00
PKEuS
ebd0b43c4f
Fixed #5382 : False positive "scope can be reduced" when initializing two-dimensional array.
2014-03-17 12:34:39 +01:00
PKEuS
d325d14b11
Fixed false positive #5535 : Reference named like its type.
2014-03-17 12:01:39 +01:00
PKEuS
50f6bb5d36
Fixed crash #5511 .
2014-03-17 11:50:45 +01:00
PKEuS
86e6bb430a
New check: Warning, if positioning operation (fseek) is performed on a file opened in "a" mode
2014-03-17 11:02:03 +01:00
PKEuS
1e57f54917
Fixed #5481 : std::array is POD, so using memcpy (etc.) is allowed on it.
2014-03-16 19:55:32 +01:00
Martin Ettl
80b1271d01
Astyle running and added test cases for functions in std.cfg.
2014-03-10 02:21:44 +01:00
Lucas Manuel Rodriguez
9a08da17be
Fixed #4928 (C++ operator aliases result in false 'assigned a value that is never used' warning)
2014-03-16 14:51:05 -03:00
PKEuS
e05fb847df
Fixed #3852 : Support simplification of C++11 "enum class", fixed existing simplifications
2014-03-16 18:24:46 +01:00
PKEuS
6b16b519a2
Fixed crash on wrong __attribute__((constructor)) syntax
2014-03-16 16:39:07 +01:00
Alexander Mai
cba1879fee
Fixed #5571 (Clean up MathLib::isInt())
2014-03-16 11:55:44 +01:00
Daniel Marjamäki
8c3f2c2ad9
Revert 894a65b0
. abstract interpretation of for loops. there was some crashes and performance problems. I will fix those problems when I have time and recommit.
2014-03-16 08:38:52 +01:00
Alexander Mai
40ddcabab6
Fixed #4461 (Warn about memset/memcpy on class with references as members)
2014-03-15 18:22:29 +01:00
Daniel Marjamäki
894a65b0b1
ValueFlow: Refactor the for-loop handling. Use abstract interpretation.
2014-03-15 11:29:33 +01:00
Robert Reif
2ba3a36f2c
Partial fix for #5555 . Improved pure/const attributes handling
2014-03-14 19:06:05 +01:00
Robert Reif
e26bd5b99c
Fixed #5563 (add __attribute__((destructor)) and improve __attribute__((constructor)) support)
2014-03-14 18:17:21 +01:00
Daniel Marjamäki
8c7cf090c4
Merge pull request #261 from orbitcowboy/master
...
MathLib:isHex(): fix detection of missing suffixes (U,L).
2014-03-14 13:00:35 +01:00
Daniel Marjamäki
8d8913a168
Partial fix for #5555 . Add const,pure attributes to library.
2014-03-14 06:38:45 +01:00
Robert Reif
cb1fc06a80
Fixed #5079 (CheckIO::checkFileUsage doesn't support wide char and microsoft functions)
2014-03-12 19:22:44 +01:00
Frank Zingsheim
b1dc51ba9c
Fixed #4796 (Missing semicolon after simplified template class)
2014-03-12 06:09:45 +01:00
Robert Reif
d1eb04c539
Fixed #4302 (Member variable not initialized in public delegate constructor)
2014-03-12 05:48:13 +01:00
Daniel Marjamäki
618c26f6bf
Merge pull request #260 from orbitcowboy/master
...
MathLib::isOct() fix missing detection of U and L suffix combinations an...
2014-03-12 05:30:35 +01:00
Daniel Marjamäki
3b4d024e06
Reverted info message that only applies to CLI
2014-03-11 20:55:02 +01:00
orbitcowboy
ed793793db
MathLib:isHex(): fix detection of missing suffixes (U,L).
2014-03-11 20:02:04 +01:00
Daniel Marjamäki
94454df14f
Fixed #2732 (Make it easier for users to tell 'How to supply header files')
2014-03-11 16:05:19 +01:00
Daniel Marjamäki
af0cf9bbc1
Merge pull request #258 from orbitcowboy/master
...
MathLib::isBin(): fix missing detection of U and L suffix combinations. ...
2014-03-11 06:36:31 +01:00
orbitcowboy
5b4ece4f9c
MathLib::isBin(): fix missing detection of U and L suffix combinations. Added missing test cases.
2014-03-10 17:23:07 +01:00
Martin Ettl
0360840753
MathLib::isOct() fix missing detection of U and L suffix combinations and unittests.
2014-03-09 21:14:14 +01:00
Daniel Marjamäki
4d06bc086d
astyle formatting
2014-03-09 08:49:32 +01:00
Daniel Marjamäki
7fa73c0d64
Merge pull request #256 from xypron/5505
...
5505: FP: Array accessed out of bounds
2014-03-09 08:47:18 +01:00
Daniel Marjamäki
c7f09d4350
Merge pull request #257 from simartin/ticket_5373_2
...
Ticket #5373 : delete can match %type% in C (take #2 )
2014-03-09 08:26:06 +01:00
Alexander Mai
3f30753122
Fixed #5537 (crash: clang ./lib/Basic/FileManager.cpp , since 354e84e7c8
, /lib/symboldatabase.h:288)
2014-03-09 08:17:24 +01:00
Simon Martin
a3d1cac79c
Ticket #5373 : Keep track whether tokens come from a C or C++ file to properly handle %type% in Token::Match with "delete"
2014-03-08 21:26:06 +01:00
Heinrich Schuchardt
bd67db96f1
5505: FP: Array accessed out of bounds
...
CheckBufferOverrun::checkFunctionParameter alreacy considered usage of a
function parameter inside an if block as a special case.
With the patch the same is done for switch statements.
A test is added.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2014-03-07 19:51:13 +01:00
Alexander Mai
29d401ff38
Fixed #3098 (false negative: unitialized variable being passed to strcoll())
2014-03-06 16:31:31 +01:00
Alexander Mai
354e84e7c8
Fixed #2298 (new check: passing stack-address to free())
2014-03-06 06:32:30 +01:00
Alexander Mai
1d4839b8a6
Fixed #1374 (false negative: using uninitialized variable in printf)
2014-03-06 06:16:14 +01:00
Daniel Marjamäki
bcd230d90d
Merge pull request #251 from matthiaskrgr/copyright
...
man, htdocs, gui, test, tools: bump a few more copyrights to 2014
2014-03-04 05:44:50 +01:00
Daniel Marjamäki
afeb4667a8
astyle formatting
2014-03-03 19:00:44 +01:00
Pranav Khanna
f8a4fb91fe
Fixed #3796 (new check: redundant initialization with empty string)
2014-03-03 18:27:45 +01:00
Matthias Krüger
a9df4a3288
man, htdocs, gui, test, tools: bump a few more copyrights to 2014
2014-03-03 11:03:17 +01:00
Simon Martin
8baf8dbebb
Ticket #5425 : Avoid infinite recursion in checkMemsetType for invalid input
2014-03-03 07:19:32 +01:00
Daniel Marjamäki
31755b621c
Merge pull request #246 from simartin/ticket_5356
...
Ticket #5356 : Added test case that works following the fix for #5506 .
2014-03-02 14:55:52 +01:00
Daniel Marjamäki
4dee3da1bd
Merge pull request #245 from simartin/ticket_5478
...
Ticket #5478 : Only functions and equal operators might return a temporary
2014-03-02 14:53:25 +01:00
Simon Martin
4057242cb2
Ticket #5356 : Added test case that works following the fix for #5506 .
2014-03-02 10:10:58 +01:00
Simon Martin
875a3f47e7
Ticket #5478 : Only functions and equal operators might return a temporary.
2014-03-02 09:39:10 +01:00
Daniel Marjamäki
16e06b3f2a
Merge pull request #243 from simartin/ticket_5050_testcase
...
Ticket #5050 : Added test case since it works now.
2014-03-02 08:54:53 +01:00
Simon Martin
3518e02d23
Ticket #5506 : Skip template parameters when determining whether a template is a declaration or a definition.
2014-03-01 14:58:47 +01:00
Simon Martin
ef3f135af2
Ticket #5050 : Added test case since it works now.
2014-03-01 10:37:55 +01:00
Alexander Mai
50a184c3e9
Fixed #5166 (segmentation fault (invalid code) in lib/checkother.cpp:329 ( void * f { } void b ( ) { * f } ))
2014-02-27 18:24:51 +01:00
Alexander Mai
a02bbfa47e
Fixed #5492 (Fix small bug in MathLib::isFloat())
2014-02-27 16:08:49 +01:00
Daniel Marjamäki
7dbfd67da3
Fixed #5493 (False positive: Found a statement that begins with numeric constant / string constant - in the presence of initialization list.)
2014-02-26 06:18:52 +01:00
Daniel Marjamäki
8550289722
Fixed #5452 (AST: wrong handling of unary ::)
2014-02-25 06:36:10 +01:00
Alexander Mai
0747b55485
Fixed #5304 (Wrong simplification of numbers like 001E+07 to 1.0)
2014-02-24 18:52:31 +01:00
Daniel Marjamäki
8dd7f02e45
Fixed #5381 (Some false positives that came up when using --enable=performance file.c)
2014-02-23 11:02:39 +01:00
Martin Ettl
c3a08bf108
TestMathLib: added robustness tests for testing MathLib::isFloat. Ensure it works correctly for preceeding and trailing white spaces.
2014-02-22 21:36:51 +01:00
Martin Ettl
01730d4d16
#5304 : added a losts of TODO testcases for MathLib::isFloat().
2014-02-22 19:55:57 +01:00
Martin Ettl
42a3c5d083
#5304 : added a losts of TODO testcases for MathLib::isFlot().
2014-02-22 19:50:40 +01:00
Daniel Marjamäki
f6b42633e8
Fixed #5434 (FP: Out-of-bounds access with ternary operator in loop)
2014-02-22 17:59:12 +01:00
Daniel Marjamäki
34730f623a
Fixed #5301 (False positive: (error) Division by zero - variables read from input stream)
2014-02-22 12:09:54 +01:00
Alexander Mai
82a2279425
Fixed #5304 (Wrong simplification of numbers like 001E+07 to 1.0)
2014-02-20 16:56:49 +01:00
Daniel Marjamäki
ed9153ee80
Symbol database: added simple mismatch check in Scope::findFunction when passing address to function that expects a reference
2014-02-19 06:35:51 +01:00
Daniel Marjamäki
690c37633b
ValueFlow: Fixed bad values after break/continue
2014-02-17 20:07:38 +01:00
Daniel Marjamäki
c050a92bae
Fixed #5468 (crash: freebsd: llvm/RegionPrinter.cpp - AST failure)
2014-02-17 17:37:39 +01:00
Daniel Marjamäki
d37359217c
Merge pull request #241 from lanurmi/more-nullptr
...
Change some more 0 literals into nullptr.
2014-02-16 23:29:23 +01:00
Lauri Nurmi
70a67eaf85
Change some more 0 literals into nullptr.
2014-02-16 13:38:50 +02:00
Daniel Marjamäki
fdcb325d70
DuplicateBranch: Made warning inconclusive since it's in most cases noise
2014-02-16 11:04:27 +01:00
Daniel Marjamäki
23efc68dd7
use nullptr
2014-02-16 10:32:10 +01:00
Lucas Manuel Rodriguez
052840f8f5
Fixed #4818 (New check: Check memset() 2nd parameter)
2014-02-15 15:06:00 -03:00
Daniel Marjamäki
fd3a8a2a18
Update copyright
2014-02-15 07:45:39 +01:00
Daniel Marjamäki
a1d9873558
Fixed #5465 (crash: AST doesnt produce good output for 'class C:public : 🅰️ :b<c>{..};')
2014-02-14 06:30:51 +01:00
Pavel Roschin
df69f4e4be
Library: add mk[sd]temp to Posix
2014-02-11 17:02:33 +04:00
Daniel Marjamäki
8305015dea
astyle formatting
2014-02-08 08:51:38 +01:00
Pavel Roschin
19a8cfd960
Library: add new "define" tag
...
This tag will allow to add some preprocessor defs into library.
It would be useful to provide more information about libraries
implementation details. As example GLib's library include tag
was added that helps to detect more memory leaks.
2014-02-07 10:13:36 +04:00
Daniel Marjamäki
3c0619cba5
astyle formatting
2014-02-05 18:49:34 +01:00
Pavel Roschin
4f38d7ae31
Library: add full GLib/GTK support
2014-02-05 19:52:24 +04:00
Daniel Marjamäki
3c6bfac89c
Merge pull request #234 from scriptum/rpg-use-whitelist-from-library
...
CheckMemoryLeak: use library while checking whitelist functions
2014-02-05 11:41:47 +01:00
Daniel Marjamäki
ec80068cd9
Merge pull request #228 from simartin/osx_build_restore
...
RFC: Restore build on OSX
2014-02-05 11:30:34 +01:00
Pavel Roschin
0dd227419d
CheckMemoryLeak: use library while checking whitelist functions
2014-02-05 12:16:50 +04:00
Daniel Marjamäki
6ac9e180e0
ast: fixed hang when checking beid
2014-02-05 06:05:48 +01:00
Daniel Marjamäki
2ed3b40937
ast: fixed hang when checking bin-prot
2014-02-04 19:33:26 +01:00
Daniel Marjamäki
486a3192c0
Fixed #5246 (false positive: (warning) Logical conjunction always evaluates to false: t > 0 && t < 1.)
2014-02-04 06:50:29 +01:00
Daniel Marjamäki
8c40f4fee0
astyle formatting
2014-02-03 18:51:07 +01:00
Daniel Marjamäki
ed4fa9f154
Merge pull request #231 from scriptum/rpg-add-glib-tests
...
Add GLib library, add GLib tests (some new bugs found)
2014-02-02 10:49:33 -08:00
Daniel Marjamäki
ec61143623
Merge pull request #233 from orbitcowboy/master
...
Fixed #389 : Providing negative value to memory allocation function.
2014-02-02 10:47:37 -08:00
Pavel Roschin
651ebcf17b
Add GLib library, add GLib tests (some new bugs found)
2014-02-02 22:45:57 +04:00
Daniel Marjamäki
ef35b6b1b4
Merge pull request #230 from xypron/5355
...
5355: False positive var not assigned
2014-02-02 10:10:55 -08:00
Daniel Marjamäki
0166a717c5
Merge pull request #229 from scriptum/#3236
...
Added regression for #3236
2014-02-02 09:52:14 -08:00
Heinrich Schuchardt
6bfd4af5f7
5355: False postive var not assigned
...
Avoid false positive "variable not assigned" for
struct Fred{
};
void foo () {
Fred fred;
throw fred;
}
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2014-02-01 22:40:35 +01:00
Martin Ettl
6ca7daec10
Fixed #389 : Providing negative value to memory allocation function.
2014-02-01 22:38:29 +01:00
Pavel Roschin
e06e96e864
Added regression for #3236 (Failure to detect memory leak if pointer members are added)
2014-02-01 15:51:29 +04:00
Simon Martin
8ff9696374
OSX's compiler supports C++11 but one needs to use GNU's STL to build cppcheck, that does not have cbegin/end.
2014-02-01 07:40:08 +01:00
Daniel Marjamäki
b3bfd5014d
Fixed #5433 (FP:Possible null pointer dereference)
2014-01-31 15:43:34 +01:00
Daniel Marjamäki
9aa9530e0d
Fixed #5426 (crash: btrfs-progs cmds-inspect.c)
2014-01-31 06:19:36 +01:00
Lucas Manuel Rodriguez
a34d2eb7b3
Fixed #4938 : (.empty() method false positive for non-STL classes)
2014-01-30 18:09:24 -03:00
Daniel Marjamäki
d6e3b3d3f3
ast: fixed syntax tree for 'a=(b)?1:0'. The parentheses should not be in the syntax tree
2014-01-30 17:31:06 +01:00
Daniel Marjamäki
30b56437c1
Merge pull request #226 from scriptum/rpg-fix-function-parameter
...
CheckMemoryLeak: improve leak checking in function parameters
2014-01-28 20:32:56 -08:00
Daniel Marjamäki
312780b6fc
TestTokenizer: refactored line2 test case
2014-01-28 17:18:28 +01:00
Kamil Dudka
dee18d10a8
Fixed #5423 (fix parsing of #line NNNN "file.c")
2014-01-28 17:15:07 +01:00
Daniel Marjamäki
abe8439917
Fixed #5416 (False positive: Array accessed at index, which is out of bounds.)
2014-01-28 16:55:10 +01:00
Lucas Manuel Rodriguez
2048313915
Add Variable::isStlType function
2014-01-28 11:44:56 -03:00
Pavel Roschin
2396073262
CheckMemoryLeak: improve leak checking in function parameters
2014-01-28 17:30:36 +04:00
Daniel Marjamäki
2108251851
Fixed #5417 (ast: avoid hang when '({})' is used)
2014-01-28 06:11:53 +01:00
Daniel Marjamäki
b8b573321e
CheckNullPointer: Update std.cfg and test that updates are correct
2014-01-27 17:33:16 +01:00
Daniel Marjamäki
6e6de82323
CheckMemoryLeak: test alloc/dealloc configuration in posix.cfg
2014-01-27 16:51:18 +01:00
Daniel Marjamäki
c8a1424e10
Fixed #5406 (crash inside valueFlowBeforeCondition() on files from kernel-git)
2014-01-27 06:18:42 +01:00
Daniel Marjamäki
2b8cf462c9
CheckMemoryLeak: Move posix-opendir/closedir to library
2014-01-26 17:02:36 +01:00
Daniel Marjamäki
87b67e9b77
TestNullPointer: Added test configuration for 'memcmp' that is needed by a test
2014-01-26 16:32:28 +01:00
Daniel Marjamäki
0c47555423
CheckNullPointer: use library instead of hard coded info
2014-01-26 16:19:49 +01:00
Daniel Marjamäki
be082a8e4a
value flow: added bailout for conditional return/continue/break when number_of_if is bigger than 0
2014-01-26 15:50:25 +01:00
Daniel Marjamäki
c5971b7137
value flow: fix fp when conditional value is assigned
2014-01-25 20:14:49 +01:00
Daniel Marjamäki
c1e35e1df1
value flow: fixed multivariable problem in condition
2014-01-25 19:13:33 +01:00
Daniel Marjamäki
df0995edf5
Fixed #5403 (Value flow: FP because post increment/decrement is not handled correctly)
2014-01-25 18:31:02 +01:00
Daniel Marjamäki
bc9ad08831
Fixed #5245 (false positive: Uninitialized variable (assignment inside ternary operator))
2014-01-25 10:12:50 +01:00
Daniel Marjamäki
35b51468cb
value flow: Fixed FP for division then check in for loop: 'for (a=b/x;x>0;x--)'
2014-01-25 09:22:32 +01:00
Daniel Marjamäki
4647a9fc93
Fixed #5401 (value flow: fp when there are increment/decrement)
2014-01-24 18:22:38 +01:00
Daniel Marjamäki
1cac7e1686
value flow: better handling in function call bailout of casting address of variable
2014-01-24 17:47:49 +01:00
Tobias Weibel
9d55265e6b
Replaced duplicated logf(2.0) with logf(2.0f) unittest
2014-01-23 16:19:30 +01:00
Daniel Marjamäki
ec034c1d59
Fixed #5386 (ast: hang when code is 'for (T a : b)')
2014-01-23 06:13:24 +01:00
Daniel Marjamäki
0dbb86f0cb
Cleanup ExecutionPath from CheckBufferOverrun
2014-01-22 21:25:37 +01:00
Daniel Marjamäki
1d7bb05faf
Remove ExecutionPath from CheckNullPointer
2014-01-22 20:24:51 +01:00
Daniel Marjamäki
f3f7e6d302
value flow: replacing executionpath checking of null pointers
2014-01-22 20:16:31 +01:00
Daniel Marjamäki
43db1ee797
value flow: use more specific bailouts when analysing value flow after assignment
2014-01-22 06:38:25 +01:00
Daniel Marjamäki
cc38dec3ad
value flow: a bit better handling of assigned variable
2014-01-22 06:10:17 +01:00
Daniel Marjamäki
a27ccbd0f8
value flow: start implementing value flow analysis of assigned value
2014-01-21 21:13:49 +01:00
Daniel Marjamäki
b91f42453b
value flow: improved handling of cast
2014-01-20 22:26:55 +01:00
Daniel Marjamäki
bb3cc67aaa
value flow: improved calculations that depends on variable
2014-01-20 21:45:30 +01:00
Daniel Marjamäki
98305e9163
astyle formatting
2014-01-20 06:31:28 +01:00
Daniel Marjamäki
7ff7bc1c2e
Fixed #5376 (false positive: zerodivcond (style) Either the condition 'B>0' is useless or there is division by zero)
2014-01-19 20:16:55 +01:00
Daniel Marjamäki
84c5f47eb1
value flow: bailout for class variables that are non-const
2014-01-19 11:55:02 +01:00
Daniel Marjamäki
ccda78f347
value flow: fixed todo assertion for handling of conditions
2014-01-19 09:31:40 +01:00
Daniel Marjamäki
cdaa7abf7e
value flow: better handling of conditional code below || && ?: operators
2014-01-19 09:05:48 +01:00
Daniel Marjamäki
77f3f6c21a
valueflow: added setTokenValue that perform calculations using set value
2014-01-18 19:30:44 +01:00
Daniel Marjamäki
6a3a9ee8e7
ast: fixed tree for 'sizeof(struct S)'
2014-01-18 13:18:11 +01:00
Daniel Marjamäki
c7032a8867
value flow: improved handling of loops
2014-01-18 11:54:00 +01:00
Daniel Marjamäki
d0d56aee4a
TestValueFlow: split up valueFlowBeforeCondition into smaller functions
2014-01-18 08:45:24 +01:00
Daniel Marjamäki
3e23e243f6
BufferOverflow: Updated message for out of bounds array index or redundant condition
2014-01-17 19:44:45 +01:00
Daniel Marjamäki
57d318b2e5
valueflow: better handling of increment/decrement
2014-01-17 19:28:28 +01:00
Daniel Marjamäki
18d6285ad2
BufferOverrun: Improved error message when array index is used before checking that its in limits
2014-01-17 18:56:46 +01:00
Daniel Marjamäki
36acfb6d20
Fixed Cppcheck warning. db is dereferenced before its checked against NULL
2014-01-17 18:10:10 +01:00
Daniel Marjamäki
30cae358d8
Removed the --value-flow flag. ValueFlow analysis will always be enabled from now on.
2014-01-17 18:07:05 +01:00
Daniel Marjamäki
3facc06cb7
CheckOther: Removed non-valueflow check for division by possible zero before condition
2014-01-17 17:42:54 +01:00
Daniel Marjamäki
0203a4a6f5
Tokenizer: Removed simplifyGoto as it's the cause of various FPs I see
2014-01-17 17:36:45 +01:00
Daniel Marjamäki
4eb746d7cc
Tokenizer: Removed simplifyComparisonOrder
2014-01-17 17:25:56 +01:00
Daniel Marjamäki
0b4de97e2b
value flow: Use ValueFlow in CheckBufferOverrun
2014-01-16 19:23:14 +01:00
Daniel Marjamäki
85b73f7c24
ast: fixed hang for weird loop: 'for (each_window(list,p))'
2014-01-16 16:58:50 +01:00
Daniel Marjamäki
e72ec830ef
ast: fixed hang in for-loop handling
2014-01-16 06:45:35 +01:00
Daniel Marjamäki
141e089329
ast: different handling of for loops. create a syntax tree for whole 'f(a;b;c)'.
2014-01-15 17:32:14 +01:00
Daniel Marjamäki
d43191a9e3
value flow: remove duplicate test case
2014-01-14 18:13:17 +01:00
Daniel Marjamäki
c547c9a108
value flow: fixed fp when variable is used in for-loop condition
2014-01-14 17:57:50 +01:00
Daniel Marjamäki
e45a2e2c61
Fixed #5347 (False positive: uninitialized variable (try catch))
2014-01-14 06:24:09 +01:00
Robert Reif
d679a4c1f7
Fixed #5248 (False positive: Invalid argument in scanf for %zd)
2014-01-14 06:09:13 +01:00
Daniel Marjamäki
eb774054b0
Merge pull request #210 from matthiaskrgr/travis
...
travis: rewrite config file.
2014-01-13 10:44:36 -08:00
Daniel Marjamäki
7981e3d38f
value flow: fix fp when gotos are used
2014-01-13 16:07:25 +01:00
Daniel Marjamäki
b1bbb23225
value flow: fixed fp when checking symboldatabase
2014-01-13 05:52:28 +01:00
Matthias Krüger
962018b722
revert: commit f6da9d4e3c
...
"testcmdlineparser: comment out unused functions fileListStdin(), ignorepaths{1-4}(), ignorefilepaths{1,2}()"
instead suppress the files.
also suppress unused variable in test/testpreprocessor.cpp
2014-01-12 22:47:21 +01:00
Daniel Marjamäki
c9e9262682
value flow: use checknullpointer checking based on new value flow analysis in the TestNullPointer
2014-01-12 19:51:05 +01:00
Daniel Marjamäki
5d2a39b580
CheckNullPointer: improved function call checking when new value flow analysis is used
2014-01-12 19:27:26 +01:00
Daniel Marjamäki
2e67ca06c0
value flow: some simplifications in unknown functions when there is library configuration
2014-01-12 18:19:00 +01:00
Daniel Marjamäki
d700114edf
value flow: bailout if condition is defined by macro
2014-01-12 17:16:51 +01:00
Daniel Marjamäki
bef56d7a70
reverted change I pushed by mistake
2014-01-12 15:44:40 +01:00
Daniel Marjamäki
424675982a
dmake: use -std=c++0x instead of -std=c++11 as it's supported by earlier gcc
2014-01-12 15:38:51 +01:00
Heinrich Schuchardt
f6510a6b45
Fixed #5339 (Tokenizer::setVarId : function-pointer function argument not getting variable id, causing FP)
2014-01-12 15:15:09 +01:00
Daniel Marjamäki
3d79613f2b
value flow: more bailouts when return/break/continue/goto is reached. TODO: handle these better.
2014-01-12 15:07:58 +01:00
PKEuS
b775714e3d
Moved several hardcoded function names in format string checking into libraries (std.cfg and windows.cfg).
...
Added support for loading a library in test suite.
2014-01-12 03:44:24 -08:00
Daniel Marjamäki
d8262963d9
value flow: condition in loop, bailout valueflow analysis before loop if there is assignment inside the loop
2014-01-12 11:58:10 +01:00
Daniel Marjamäki
e3496080c8
Fixed #5334 (False positive: same expression on both sides of '||')
2014-01-12 07:40:56 +01:00
Daniel Marjamäki
f58e1ab80e
value flow: fixed fp in switch
2014-01-11 21:21:00 +01:00
Daniel Marjamäki
3625d179e5
value flow: don't perform value flow analysis in sizeof/typeof expressions
2014-01-11 21:10:01 +01:00
Daniel Marjamäki
680d3f1312
value flow: fixed fp for nested assignments
2014-01-11 20:53:23 +01:00
Daniel Marjamäki
4d045879aa
value flow: fixed fp when while condition contains variable that is changed in loop body
2014-01-11 20:25:49 +01:00
Daniel Marjamäki
75f9111775
value flow: bailout when variable is used in assignment to itself
2014-01-11 15:36:09 +01:00
Daniel Marjamäki
1fc2c9fe79
ast: fixed syntax tree for statement enclosed in parentheses ';(expr);'
2014-01-11 15:18:39 +01:00
Daniel Marjamäki
ceca6be22b
Fixed #5334 (False positive: same expression on both sides of '||')
2014-01-11 15:15:01 +01:00
Daniel Marjamäki
eaf8c83db5
value flow: refactoring. broke out function for skipping value simplifications in expressions.
2014-01-11 14:54:10 +01:00
Daniel Marjamäki
85dcb14813
value flow: bailout in valueFlowBeforeCondition if variable can be assigned by subfunction
2014-01-11 14:31:51 +01:00
Daniel Marjamäki
02b92efd1a
value flow: improved analysis of expressions below ?, && and || operators
2014-01-11 12:44:55 +01:00
Daniel Marjamäki
60348da1b5
value flow: fixed fp for rhs in && and || expressions
2014-01-11 11:30:34 +01:00
Daniel Marjamäki
4e7e56df9f
astyle formatting
2014-01-11 07:54:06 +01:00
Daniel Marjamäki
1ad94a8be5
value flow: loosen up bailouts in valueFlowSubFunction
2014-01-11 07:52:25 +01:00
Matthias Krüger
f6da9d4e3c
testcmdlineparser: comment out unused functions fileListStdin(), ignorepaths{1-4}(), ignorefilepaths{1,2}()
2014-01-10 21:08:12 +01:00
Matthias Krüger
4f918e1c8c
testsuite: remove function todoAssert() which is unused according to cppcheck.
2014-01-10 21:08:11 +01:00
Matthias Krüger
d9ce61a9d6
testsuite: according to cppcheck, the function printTests() is not used, remove it.
2014-01-10 21:08:11 +01:00
Matthias Krüger
6feb0faf4c
testbool: same for checkComparisonOfBoolWithBool
2014-01-10 21:08:11 +01:00
Matthias Krüger
3602cc2f6a
testsymboldatabase: run symboldatabase32, probably someone forgot to implement this.
2014-01-10 21:08:11 +01:00
Daniel Marjamäki
c687933e9f
value flow: improved handling of for loops
2014-01-10 18:19:24 +01:00
Daniel Marjamäki
3eebc8a9f1
test1
2014-01-10 16:51:58 +01:00
Daniel Marjamäki
acb103e214
value flow: skip scopes that don't contain variable
2014-01-10 16:13:39 +01:00
Daniel Marjamäki
d085705e8f
value flow: assume that value of global const variable is not changed
2014-01-10 05:47:56 +01:00
Daniel Marjamäki
752e9d0fb7
Tokenizer::varId: Fixed wrong varid for shadow types with same names as class members
2014-01-09 21:44:29 +01:00
Daniel Marjamäki
1be30bf022
ast: fixed handling of templates
2014-01-09 17:14:16 +01:00
XhmikosR
96b62c6ccb
Fix the C4800 warnings.
2014-01-09 16:58:42 +02:00
Daniel Marjamäki
04cb56e070
ast: fixed trouble with 'ab=a+(b/(c))+d;' where the '(c)' could be mistaken for a cast
2014-01-08 21:49:42 +01:00
Daniel Marjamäki
4f11086505
Tokenizer: Don't remove parentheses in 'a?b:(c>0?d:e)'
2014-01-08 20:53:33 +01:00
Daniel Marjamäki
644004573b
Preprocessor: fixed 8.0E+007 in macros
2014-01-08 18:05:14 +01:00
Daniel Marjamäki
7c4a7ac3d5
value flow: starting to refactor CheckNullPointer::nullPointerDeRefThenCheck
2014-01-08 17:37:39 +01:00
Daniel Marjamäki
9c50deda64
value flow: reverted TestOther, don't use value flow in test cases yet
2014-01-08 16:18:50 +01:00
Daniel Marjamäki
a2fe1ebe92
value flow: pass result of bool operator to function
2014-01-08 16:17:47 +01:00
Daniel Marjamäki
6d22c9deaa
value flow: if unsigned variable is compared against 1 with either >= or <= then assume it can have the value 0
2014-01-08 06:53:17 +01:00
Daniel Marjamäki
1e3c43e708
value flow: improved bailouts in ?:
2014-01-08 06:39:15 +01:00
Daniel Marjamäki
dfee044925
value flow: Fixed wrong value in subfunction after conditional return
2014-01-08 06:04:51 +01:00
Daniel Marjamäki
1fb0b1750c
value flow: Fixed FP in ?:
2014-01-07 19:46:13 +01:00
Daniel Marjamäki
740f72fdbd
value flow: simple handling of for loops
2014-01-07 19:20:56 +01:00
Martin Ettl
fa04273473
Merge branch 'master' of https://github.com/danmar/cppcheck
2014-01-06 18:51:15 +01:00
Daniel Marjamäki
a6320a35e0
value flow: added experimental subfunction handling
2014-01-06 16:37:52 +01:00
Daniel Marjamäki
58fb2e756b
Value flow: added bailout on }
2014-01-06 11:27:56 +01:00
Daniel Marjamäki
d172e9bb29
value flow: Fixed testing
2014-01-06 10:09:49 +01:00
Daniel Marjamäki
c4fa3bb137
value flow: added bailouts for global variables and assignments
2014-01-06 07:44:58 +01:00
Daniel Marjamäki
c32d0f1992
CheckInternal: Improved checking of multiCompare patterns. The multiCompare pattern can contain any %cmd% until there is non-%cmd% used. For instance %var%|%num% is handled ok.
2014-01-05 23:03:36 +01:00
Daniel Marjamäki
4620284cbf
astyle formatting
2014-01-05 22:06:11 +01:00
Daniel Marjamäki
62c608141d
CheckInternal: Improved checking of multiCompare patterns
2014-01-05 21:15:41 +01:00
Graham Whitted
86201c13cb
Fixed #5097 (TemplateSimplifier::expandTemplate assertion failure)
2014-01-05 19:19:52 +01:00
Alexander Mai
77362fd671
Fixed #5289 (Crash: Stack overflow in isImplicitlyVirtual_rec when checking SVN)
2014-01-05 19:10:16 +01:00
Daniel Marjamäki
29c64cc34c
Merge pull request #209 from simartin/ticket_5266
...
Ticket #5266 : Properly tokenize "complex" static variable declarations.
2014-01-05 04:44:22 -08:00
Daniel Marjamäki
deb3699bd8
value flow: Updated Visual Studio files
2014-01-05 09:52:37 +01:00
Daniel Marjamäki
d8270c710a
Add new experimental value flow analysis
2014-01-04 20:57:02 +01:00
Daniel Marjamäki
f1054a50f6
Merge pull request #208 from simartin/ticket_5201
...
Ticket #5201 : Get rid of internal error when checking valid C input for leaks
2014-01-04 05:18:44 -08:00
PKEuS
574c27b1b2
Removed VS9 solution
2014-01-04 10:55:27 +01:00
Simon Martin
d2cf9fd77c
Ticket #5266 : Properly tokenize "complex" static variable declarations.
2014-01-04 10:49:27 +01:00
Simon Martin
6019f45249
Ticket #5201 : Get rid of internal error when checking valid C input for memory leaks.
2014-01-03 23:27:56 +01:00
Daniel Marjamäki
7125682d1a
Fixed #5274 (TokenList: macro handling)
2014-01-03 18:53:37 +01:00
Robert Reif
cbe3862599
Fixed #5264 (Size specifier in printf functions is wrong for some types)
2014-01-03 15:58:45 +01:00
Zachary Blair
7a6386bc4b
Fixed #4867 (Memory Leak: Return value of malloc)
2014-01-03 10:12:32 +01:00
Daniel Marjamäki
372c29c24e
Fixed #5284 (duplicateExpression falsely reported by members of a union in some circumstances)
2014-01-02 16:58:07 +01:00
Daniel Marjamäki
2f91539d1d
Preprocessor: don't insert macroChar inside .1 and 1. tokens
2014-01-02 11:21:23 +01:00
Daniel Marjamäki
a1b0d190df
Fixed #3688 (false positive: (inconclusive, posix) (warning) The buffer 'cBuffer' is not zero-terminated after the call to readlink().)
2014-01-02 10:46:19 +01:00
Martin Ettl
5a5277f2fa
Tokenizer::simplifyVarDecl: Fixed crash when checking garbage code.
2014-01-01 19:15:32 +01:00
Martin Ettl
0dccd3a632
Tokenizer:simplifyFlowControl(): Fixed crash on garbage code.
2014-01-01 19:04:02 +01:00
Daniel Marjamäki
d62055277d
Fixed #4787 (False Positive: Unused private function)
2014-01-01 18:36:51 +01:00
Alexander Mai
5539e9ea0f
Fixed #5279 (False positive: warning (uninitMemberVar): Member variable 'ToDoubleArray::mfNaN' is not initialized in the constructor. (modified #5170 example))
2014-01-01 18:34:39 +01:00
Daniel Marjamäki
cd65d8e54f
Fixed #5169 (Preprocessor::removeComments : Bad handling of __asm)
2014-01-01 12:44:59 +01:00
Daniel Marjamäki
32be4094e7
Symbol database: only put variables in variable list
2013-12-31 17:51:56 +01:00
PKEuS
621cf6e777
Support arrays as template parameters in TemplateSimplifier::templateParameters
2013-12-31 13:59:32 +01:00
PKEuS
6f76dfcb22
Forward declare tinyxml type used in library.h to avoid problems with dynamic linked configuration.
2013-12-31 12:30:17 +01:00
Daniel Marjamäki
7e71c41ba7
Preprocessor: Don't insert macroChar inside 1.f and 1.e+7 as that mess it up later. Thanks ettlmartin for telling me about this.
2013-12-31 10:24:14 +01:00
Daniel Marjamäki
99703e1a3f
Preprocessor: make sure 1E-7, 1E+7, 1e+7 in macros is output as a single token. Putting a macroChar before the 7 mess it up later.
2013-12-30 18:03:24 +01:00
PKEuS
4f0121ee2f
Splitted simplification out of tokenize()
2013-12-30 17:45:28 +01:00
Daniel Marjamäki
582baa5648
Preprocessor: make sure 1e-7 is output as a single token. puttin a macroChar before the 7 mess it up later.
2013-12-29 21:51:01 +01:00
Daniel Marjamäki
41e4194573
Tokenizer: set links for <> in 'a=new b<c>;' code
2013-12-29 15:37:27 +01:00
Daniel Marjamäki
e13aa0dbc3
Fixed #5275 (FP mismatchAllocDealloc: user defined opendir()/closedir() on non-POSIX system)
2013-12-29 09:51:29 +01:00
Daniel Marjamäki
4b72f01e99
clarify calculation: Fixed FP for 'a = (*p ? 1 : 2)'
2013-12-28 11:02:39 +01:00
Daniel Marjamäki
e0eb000ac3
AST: Fixed problem with decrement
2013-12-27 14:40:59 +01:00
Daniel Marjamäki
872b6e8fcc
Fixed VS compiler warning. Using 'struct' for class. Thanks XhmikosR for reporting.
2013-12-26 17:48:25 +01:00
Daniel Marjamäki
742a6935ea
Calculation in sizeof: Fixed FP for sizeof(Fred**)
2013-12-26 13:52:58 +01:00
Daniel Marjamäki
29e74222fb
Sizeof calculation: Fixed FP for sizeof(int*[2])
2013-12-26 13:41:21 +01:00
Daniel Marjamäki
5d5e347418
AST: better handling of 'sizeof(void*)'
2013-12-25 22:08:53 +01:00
Daniel Marjamäki
915cb6c757
Fixed #5261 (AST: cast not handled well (a::b&)x)
2013-12-25 21:19:28 +01:00
Daniel Marjamäki
aa65799c19
pointerArithBool: Updated error message
2013-12-25 19:56:00 +01:00
Daniel Marjamäki
6182394966
Uninitialized variables: Fixed false positive taking value of pointer that is allocated but not initialized
2013-12-25 14:00:27 +01:00
Daniel Marjamäki
26dfddac6b
UninitVar: Fixed false positive when checking if allocated pointer is null
2013-12-24 12:48:17 +01:00
Daniel Marjamäki
4c44e62159
AST: Refactored CheckOther::clarifyCalculation
2013-12-24 10:07:20 +01:00
Daniel Marjamäki
753559fff3
Uninitialized variables: Don't warn about try/catch exception variables
2013-12-24 07:39:15 +01:00
Daniel Marjamäki
042d3afb80
CheckOther::checkDuplicateExpression: Readded warnings when there is a expression between the duplicate expressions 'X || Y || X'
2013-12-24 07:21:46 +01:00
Daniel Marjamäki
ac30a84c3a
Refactoring: Replaced CheckOther::checkCCTypeFunctions with configuration
2013-12-23 19:58:33 +01:00
Daniel Marjamäki
a3dd65caee
Fixed #5126 (new check: missing pointer dereference or pointer overflow 'if (p+1)')
2013-12-23 18:39:05 +01:00
Daniel Marjamäki
661784a170
Fixed #5255 (False positive (error) Uninitialized variable: ptr2 - calling a static member function)
2013-12-23 16:50:27 +01:00
Daniel Marjamäki
e2fa6a291c
Uninitialized variables: Fixed false negatives for loop variables / pointer dereference
2013-12-23 12:27:00 +01:00
Daniel Marjamäki
596b4bd405
astyle formatting
2013-12-23 12:26:12 +01:00
Daniel Marjamäki
e747b6c49b
Merge pull request #202 from simartin/ticket_5214
...
Ticket #5214 : Added test case (ticket already fixed in mainline).
2013-12-23 02:49:25 -08:00
Daniel Marjamäki
76b907fe65
Fixed #5252 (Improve check: use Library to validate function arguments in invalidFunctionUsage)
2013-12-23 10:06:45 +01:00
Daniel Marjamäki
be03d4718a
Library: Added <valid> element that is used to define valid input values for functions
2013-12-22 19:10:14 +01:00
Simon Martin
02dc49624d
Ticket #5214 : Don't read out of bounds upon invalid ternary operator.
2013-12-22 18:13:52 +01:00
Daniel Marjamäki
e2bc99aa24
Fixed #5154 (Tokenizer: wrong handling of msvc 'for each')
2013-12-17 06:34:27 +01:00
Daniel Marjamäki
762806499f
Fixed #5182 (Tokenizer::simplifyEnum: template function call as enum value)
2013-12-16 07:07:00 +01:00
Daniel Marjamäki
92305ed1f9
Fixed #5170 (False positive: warning (uninitMemberVar): Member variable 'ToDoubleArray::mfNaN' is not initialized in the constructor.)
2013-12-15 14:07:29 +01:00
Daniel Marjamäki
7938692b01
Fixed #5212 (Tokenizer::simplifyEnum bad simplification of enum value (1<<0)|(1<<1))
2013-12-15 07:47:04 +01:00
Daniel Marjamäki
f599e3184c
Fixed #5174 (Tokenizer: member function 'abort' returns)
2013-12-14 11:12:48 +01:00
Daniel Marjamäki
fdcb6634df
Fixed #5190 (FP Use const reference to avoid data copying)
2013-12-14 08:46:18 +01:00
Daniel Marjamäki
57ecdd693c
Fixed #5149 (false positive: (error) Dereferencing 'memory' after it is deallocated / released)
2013-12-14 07:37:24 +01:00
Daniel Marjamäki
80dec5a976
Uninitialized variables: Fixed FP when taking address of uninitialized variable
2013-12-13 20:10:22 +01:00
Daniel Marjamäki
7fe923bfc5
Uninitialized variables: Fixed FP when the variable is initialized in do-while condition
2013-12-13 13:27:01 +01:00
Daniel Marjamäki
3e6fbc6517
Fixed uninitialized variable FP after realloc if it fails. Related with ticket: #5240
2013-12-13 07:15:59 +01:00
Daniel Marjamäki
35189e80f2
Uninitialized variables: Fixed false positive for '*p=..'
2013-12-12 15:33:31 +01:00
Daniel Marjamäki
1b86615a69
Uninitialized variables: Fixed false positive for 'p=malloc; if (p) {}'
2013-12-12 11:44:07 +01:00
Daniel Marjamäki
4e7594748d
Uninitialized variables: Fixed false positive for 'p=malloc; if (python tools/daca2.py b)'
2013-12-12 09:17:41 +01:00
Daniel Marjamäki
9f62740e1d
Fixed #5236 (varid 0: vlc: src/misc/objects.c:126)
2013-12-12 08:44:00 +01:00
Daniel Marjamäki
a4f9cb78d5
Uninitialized variables: Fixed false positives when passing allocated pointer to function
2013-12-11 05:54:42 +01:00
Daniel Marjamäki
ef15e40de5
Uninitialized variables: error when passing uninit pointer to function
2013-12-10 18:36:16 +01:00
Daniel Marjamäki
5ba02d2fdd
AST: Always use AST
2013-12-09 18:06:19 +01:00
Daniel Marjamäki
be5c00d215
Uninitialized variables: check function arguments
2013-12-09 15:58:42 +01:00
Daniel Marjamäki
f686cd6516
astyle formatting
2013-12-04 20:54:37 +01:00
Daniel Marjamäki
14a00046a3
Fixed #5207 (Struct uninitialized members useage is not giving error (malloc).)
2013-12-04 20:32:20 +01:00
Simon Martin
fe75686595
Ticket #5203 : Don't crash when checking buffer overrun for invalid code.
2013-11-30 07:40:32 +01:00
Daniel Marjamäki
0c5282b1af
Fixed #5081 (False positive: (error) Uninitialized variable: f (handling of C-cast not correct))
2013-11-28 16:04:47 +01:00
Daniel Marjamäki
771dc2e1ad
AST: Improved handling when calling function through function pointer hidden within parantheses '(a.f)(1,2)'
2013-11-27 06:17:00 +01:00
Daniel Marjamäki
3b11ee9e0e
AST: Improved handling of brackets
2013-11-25 20:58:40 +01:00
Daniel Marjamäki
d8b25da73c
Fixed #4740 (False Positive: Uninitialised variable 'int *a[2][19]; int **b = a[0];')
2013-11-25 06:38:23 +01:00
Daniel Marjamäki
da540a3bb3
AST: Improved astIsFloat handling of expressions
2013-11-25 04:26:15 +01:00
Daniel Marjamäki
abdf2bb9d4
AST: fixed isSameExpressions handling of ({..})
2013-11-25 04:08:28 +01:00
Daniel Marjamäki
94e2bf7a11
AST: Handle ({..})
2013-11-25 04:07:44 +01:00
Robert Reif
43f00942dd
Fixed #5197 (SymbolDatabase: bad handling of unknown macros in function declaration)
2013-11-25 03:43:39 +01:00
Daniel Marjamäki
13cd0f41f6
AST: Fixed FP in isSameExpression when there are different casts
2013-11-24 15:17:08 +01:00
Alexander Mai
38b2f6b9b0
Fixed #5168 (segmentation fault (invalid code) in Tokenizer::simplifyVarDecl)
2013-11-24 11:07:11 +01:00
Daniel Marjamäki
8b77b7711c
Merge pull request #199 from simartin/ticket_5168
...
Ticket #5168 : Don't crash when simplifying bit-fields for invalid code.
2013-11-24 01:55:02 -08:00
Simon Martin
9817da00ec
Ticket #5168 : Don't crash when simplifying bit-fields for invalid code.
2013-11-23 20:33:03 +01:00
Daniel Marjamäki
4fe6951b4c
Library: Fixed loading of 'resource'
2013-11-23 18:16:40 +01:00
Daniel Marjamäki
7fc07989a7
UninitVar: Fixed false positive 'data is allocated but not initialized' when there is assignment
2013-11-23 10:24:29 +01:00
Robert Reif
0afdbc73da
Fixed #5195 (Crash below CheckIO::checkWrongPrintfScanfArguments())
2013-11-23 08:40:35 +01:00
Daniel Marjamäki
8cca41774d
Fixed #4446 (Crash on complex C++ template)
2013-11-21 20:27:24 +01:00
Daniel Marjamäki
2c1f579b3b
Library: Fixed formatstr handling
2013-11-21 16:32:53 +01:00
orbitcowboy
b74db1b791
Tokenize:simplifyFloatCast(): added corresponding suffix, incase of type 'float'.
2013-11-20 23:58:43 -08:00
Alexander Mai
7d45e9be73
Fixed #5122 (duplInheritedMember on private variables)
2013-11-21 05:39:23 +01:00
Daniel Marjamäki
ef108c49ec
Tokenizer: simplify enums better. add parentheses to enforce operator precedence.
2013-11-20 18:04:28 +01:00
Daniel Marjamäki
e8eeb90adb
AST: Fixed 'same expression' false positives (git merge --squash s, <<, >>)
2013-11-20 16:18:09 +01:00
orbitcowboy
1798fc3645
testtokenize:simplifyFloatCasts(): Added testcases for double and long double.
2013-11-17 08:44:05 -08:00
Daniel Marjamäki
27a40b10e1
AST/incorrectLogicOperator: Better handling of large doubles where x+1=>x
2013-11-20 06:33:34 +01:00
Daniel Marjamäki
6869d0de30
AST: Handle L'x'
2013-11-20 05:57:56 +01:00
Daniel Marjamäki
47b98470eb
Tokenizer: Simplify float casts of integer constants
2013-11-19 18:07:12 +01:00
Daniel Marjamäki
f8cf64afef
Fixed #4710 (Template parser bug: const in constructor changes template names)
2013-11-19 06:07:25 +01:00
Daniel Marjamäki
ff5f223a1d
Fixed #5116 (false positive: memset on class (nested struct))
2013-11-18 16:56:00 +01:00
Daniel Marjamäki
033cb19656
Same expression: Don't write warnings for same expression on both sides of arithmetical operators
2013-11-17 17:21:39 +01:00
Daniel Marjamäki
71e61fb1ed
Uninitialized variables: Fixed false positive when using ?:
2013-11-17 12:42:53 +01:00
Daniel Marjamäki
77e09d72a1
Uninitialized variables: Fixed false negatives when using ({})
2013-11-17 12:11:18 +01:00
Daniel Marjamäki
d342387b95
Uninitialized var: Fixed false negatives for self assignment
2013-11-16 18:07:33 +01:00
Daniel Marjamäki
2a640a59c2
Tokenizer: Improved handling of pointer aliases. This fixes some false negatives.
2013-11-16 17:30:04 +01:00
Daniel Marjamäki
cfd6b0c384
UninitVar: fixed false negatives for function calls
2013-11-16 12:02:21 +01:00
Daniel Marjamäki
8c7e3d14aa
Fixed #5119 (Preprocessor: Using -D suppresses __cplusplus for C++ files)
2013-11-15 19:21:21 +01:00
Daniel Marjamäki
30720affd6
Tokenizer::setVarId: Fixed hang when checking libgc
2013-11-15 16:16:22 +01:00
Daniel Marjamäki
5af2fe6e5b
AST: improved 'incorrect logic' checking when there are nested expressions
2013-11-15 06:51:35 +01:00
Daniel Marjamäki
d1721b9d1b
AST: Improved 'same expression on both sides of operator' checking for nested operators
2013-11-15 06:35:46 +01:00
Daniel Marjamäki
203d3e916b
Fixed #5173 (false positive Variable XX is reassigned a value before the old one has been used)
2013-11-14 16:10:00 +01:00
Daniel Marjamäki
673400920d
AST: Fixed 'a[1][2]'
2013-11-13 17:52:56 +01:00
Daniel Marjamäki
7fe51eb58b
Fixed #4989 (False positive: Wrong processing of __asm block)
2013-11-13 06:04:00 +01:00
Daniel Marjamäki
1ecade2657
AST: don't warn about duplicate expressions around '+' operator. It might be more efficient than using for instance '*2'
2013-11-11 20:03:59 +01:00
Daniel Marjamäki
58d7caded1
AST: improved handling of casts
2013-11-11 16:39:34 +01:00
Daniel Marjamäki
4027848761
incorrectLogicOperator: fixed FP when comparing char values. improved handling of float comparisons.
2013-11-10 18:06:51 +01:00
Daniel Marjamäki
807f62520c
Fixed crash caused by endless recursion in redundant assignments check
2013-11-10 17:20:40 +01:00
Alexander Mai
687aeb4f5f
Fixed #5158 (segmentation fault (valid code))
2013-11-10 16:22:52 +01:00
Daniel Marjamäki
bb746261d3
AST: Fixed crash
2013-11-10 15:51:33 +01:00
Daniel Marjamäki
0dd17f9fad
Merge pull request #198 from simartin/ticket_5073
...
Ticket #5073 : Don't crash upon invalid do-while loop.
2013-11-10 03:09:16 -08:00
Daniel Marjamäki
cadb284a3d
Refactored the AST checking of CheckOther::checkIncorrectLogicOperator()
2013-11-10 11:59:18 +01:00
Simon Martin
185b88c6e3
Ticket #5073 : Don't crash upon invalid do-while loop.
2013-11-08 23:13:21 +01:00
Daniel Marjamäki
20b84fcdee
Null pointers: Don't warn when first argument to freopen() is NULL
2013-11-08 13:22:07 +01:00
Robert Reif
52df31b501
Fixed #5153 ((debug) Scope::checkVariable found variable ')')
2013-11-08 12:56:32 +01:00
Robert Reif
a6ef3a224a
Fixed #5151 (false negative: improper formatstring - vector::at())
2013-11-08 12:44:05 +01:00
Daniel Marjamäki
b0ce42565e
AST: Added experimental new implementations for CheckAssignIf::comparison, CheckOther::checkIncorrectLogicOperator and CheckOther::checkDuplicateExpression
2013-11-07 14:38:08 +01:00
Daniel Marjamäki
fb04c8ff84
Fixed #5107 (redundantAssignment when pointer changes)
2013-11-04 23:46:07 +01:00
Daniel Marjamäki
7996d609be
Fixed #5108 (false positive: uninitialized variable (assignment in function parameter))
2013-11-04 23:09:15 +01:00
Daniel Marjamäki
6ad2491817
AST: uninstantiated template
2013-11-04 22:58:47 +01:00
Daniel Marjamäki
8ff412fcee
Fixed #5142 (False positive with floating-point special cases in conditions)
2013-11-04 11:56:43 +01:00
Daniel Marjamäki
de29991c11
AST: Rewrite using standard approach
2013-11-04 11:26:16 +01:00
Daniel Marjamki
9959c2866c
AST: fixed hang for ',&x..'
2013-11-03 15:05:58 +01:00
Daniel Marjamki
8910bae801
Fixed #5137 (Defining empty macro from commandline does not seem to work)
2013-11-03 09:46:03 +01:00
Daniel Marjamki
bcc8384a95
Fixed #5145 (False Positive: Variable 'A' hides enumerator with same name)
2013-11-03 09:34:48 +01:00
Daniel Marjamäki
5f0cfa0ee4
Fixed #4983 (False positive warning 'Possible null pointer dereference: lblList - otherwise it is redundant to check it against null.' with sizeof lblList[0])
2013-11-02 23:56:10 +01:00
Daniel Marjamäki
11abd23fa7
astyle formatting
2013-11-02 22:58:47 +01:00
Daniel Marjamäki
769b4617c3
Fixed #5142 (False positive with floating-point special cases in conditions)
2013-11-02 22:58:23 +01:00
Daniel Marjamäki
a50e5c2c23
Merge pull request #195 from simartin/ticket_5139
...
Ticket #5139 : Properly handle recursive macro definitions
2013-11-02 11:21:13 -07:00
Daniel Marjamäki
c505f5ea23
Fixed AST problem for 'if ((a.b&c)==d){}'
2013-11-02 19:18:58 +01:00
Daniel Marjamäki
bbdfd8b5c7
Make it possible to create AST, by using the --ast flag
2013-11-02 18:37:35 +01:00
Simon Martin
95c08d5613
Ticket #5139 : Properly simplify recursive macro definitions
2013-11-01 16:47:22 +01:00
Martin Ettl
5f89777182
testoptions: reverted commit 184db3900e
2013-11-01 01:28:05 +01:00
Martin Ettl
63d9fd4210
Merge branch 'master' of https://github.com/danmar/cppcheck
2013-10-29 01:48:58 +01:00
Daniel Marjamäki
e446a28b3d
Refactoring FileLister and Path so they don't depend on Library
2013-10-31 19:09:01 +01:00
Martin Ettl
184db3900e
testoptions: fixed buffer access out of bounds issue. The ctor of options requires an array of at least two elements, but.
2013-10-29 01:48:30 +01:00
Daniel Marjamäki
d3bd373798
Fixed #5131 (False Positive: %u in format string requires 'unsigned int' but the argument type is 'int'.)
2013-10-31 17:20:00 +01:00
Daniel Marjamäki
352c459e28
Merge pull request #194 from simartin/ticket_5121
...
Ticket #5121 : Handle static variable declarations depending on one another
2013-10-30 22:09:44 -07:00
Alexander Mai
14787cde99
Fixed #5129 (FP:arithOperationsOnVoidPointer on void**)
2013-10-31 06:04:51 +01:00
Daniel Marjamäki
06c5bd0daa
Fixed #5128 (False positive zerodivcond 'a ? 1 / a : 0')
2013-10-30 16:51:00 +01:00
Simon Martin
d67722ebdf
Ticket #5121 : Handle comma separated static variable declarations depending on one another
2013-10-30 15:48:00 +01:00
Simon Martin
463ef2e71e
Ticket #5120 : New test case, that works now that #5125 is fixed
2013-10-30 10:15:03 +01:00
Simon Martin
052be76635
Ticket #5125 : Avoid infinite recursion for recursive class definitions
2013-10-29 21:41:47 +01:00
orbitcowboy
097510c4ef
Tokenizer:simplifyMathFunctions_fma: added a todo testcase.
2013-10-29 09:26:26 -07:00
Daniel Marjamäki
5c072993e3
CheckBool: Fixed false negative when assigning bool to pointer '; s.p = true; '
2013-10-29 16:16:52 +01:00
orbitcowboy
e8fdf4cdd2
Tokenizer:simplifyMathExpressions: added more testcases.
2013-10-24 21:33:00 -07:00
PKEuS
bd752cabcf
Let TinyXML2 handle fopen/fclose. Added testlibrary.cpp to VS10 solution
2013-10-27 17:32:38 +01:00
Daniel Marjamäki
569a29bc4a
Library: Added simple testing
2013-10-27 17:10:43 +01:00
Robert Reif
94187c41c2
Fixed #5104 (False positive: Invalid argument in printf and scanf for vector template)
2013-10-27 10:48:49 +01:00
Daniel Marjamäki
4a6274dcc0
Merge pull request #183 from felipensp/null_ptr_typeof
...
- Fixed false positive when passing pointer to typeof()
2013-10-27 02:37:31 -07:00
Daniel Marjamäki
ec3ab74631
Preprocessor: Use set instead of list to track '#pragma once' usage
2013-10-27 10:33:37 +01:00
Daniel Marjamäki
51ad9ab6ac
Fixed #4896 (FP Uninitialized variable on template function)
2013-10-26 18:39:40 +02:00
Daniel Marjamäki
8687e85e56
Fixed #4850 (False positive: invalidIterator1 detected when iterator container is member of some struct)
2013-10-26 17:48:20 +02:00
Daniel Marjamäki
853d9dd7a9
Fixed #4956 (false positive: Variable 'myIsFirst' is assigned a value that is never used.)
2013-10-26 15:22:28 +02:00
XhmikosR
32e2a5b879
test/testother.cpp: Fix a C4800 MSVC warning.
2013-10-25 18:14:16 +03:00
Daniel Marjamäki
364757e1e1
Fixed #5089 ('inconclusive' output printed although --inconclusive not specified)
2013-10-23 06:42:52 +02:00
Daniel Marjamäki
d1b03d9c31
Fixed false positive for 'object is destroyed immediately' when there is no code after the object
2013-10-22 19:37:11 +02:00
Daniel Marjamäki
a55056c770
Fixed #5105 (false positive: (warning) Either the condition 'b!=0' is useless or there is division by zero)
2013-10-22 16:18:42 +02:00
Daniel Marjamäki
fd0f2d7900
Fixed #4929 (False positive: possible null pointer deref (checks dont handle && and || well))
2013-10-22 10:47:48 +02:00
Sam Truscott
6806fd8135
Extended Qt support through Library
2013-10-20 14:09:10 +02:00
Daniel Marjamäki
fc26de89a9
Fixed #5082 (False positive: (error) Possible null pointer dereference: p2)
2013-10-20 13:37:36 +02:00
Daniel Marjamäki
5d7e0aebf4
Fixed #5084 (False positive: (style) Same expression on both sides of '&&')
2013-10-19 18:04:53 +02:00
Daniel Marjamäki
6aa03efa2f
Fixed #5103 (Don't show 'The scope of the variable can be reduced' if there is no explicit block with { })
2013-10-19 17:27:02 +02:00
Daniel Marjamäki
f8710cb984
Fixed #5102 (Crash if -D is used when scanning simple preprocessor code.)
2013-10-18 06:47:55 +02:00
Robert Reif
b41ab8a4d5
Fixed #5088 (Token::Match called with varid 0. in libreoffice sd/source/ui/table/TableDesignPane.cxx)
2013-10-14 21:05:54 +02:00
Felipe Pena
ecb0e70250
- Fixed false positive when passing pointer to typeof()
2013-10-12 10:19:15 -03:00
Robert Reif
1fccfd50eb
Fixed #5080 ((error) Internal error. Token::Match called with varid 0. Please report this to Cppcheck developers)
2013-10-12 10:50:59 +02:00
orbitcowboy
9debeab47c
Tokenizer:simplifyMathExpressions: fixed false negative patterns for simplification.
2013-10-11 11:58:37 -07:00
Daniel Marjamäki
bb0385321f
Fixed #5074 (False positive: Duplicate expression (macro))
2013-10-13 17:42:06 +02:00
Martin Ettl
a674ed1aa9
Tokenizer:simplifyMathFunction: added simplifcation for fma[f|l]() functions.
2013-10-13 16:28:02 +02:00
Martin Ettl
e18ebf313f
Tokenizer:simplifyMathFunctions: added support for more math functions.
2013-10-13 15:41:47 +02:00
Martin Ettl
cdb47813d5
Tokenizer:simplifyMathFunctions: added support for cosh[f|l], cos[f|l] and erfc[f|l] functions.
2013-10-13 14:23:10 +02:00
Felipe Pena
c37ba4cbcf
- Fixed false positive when using typeof/__alignof__
2013-10-12 13:46:14 -03:00
Daniel Marjamäki
783bb6eb0b
Test that there is no segfault in CheckOther::checkZeroDivisionOrUselessCondition when the SymbolDatabase is invalid. Ticket: #5045
2013-10-10 22:23:52 +02:00
orbitcowboy
6eaa2f2444
Tokenizer:simplifyMathFunctions: added support for acos[f|l] functions.
2013-10-09 07:59:32 -07:00
orbitcowboy
58c09f80b6
Testother: split up a large testfunction, no functional change.
2013-10-09 07:48:46 -07:00
Daniel Marjamäki
682e68b1b6
Fixed #5077 (False positive: Comparison of boolean result with relational operator ((X + (Y < 0)) <= b))
2013-10-09 05:43:50 +02:00
Martin Ettl
f08325284c
Tokenizer:simplifyMathFunctions: added support for acosh[f|l]() functions.
2013-10-07 22:10:58 +02:00
Daniel Marjamäki
9ce7efc6e4
commaSeparatedReturn: made checking experimental for now because there are false positives ( #5076 )
2013-10-08 18:05:07 +02:00
orbitcowboy
90b2c5ddce
testtokenize: split up large testcases for simplifying math functions.
2013-10-08 07:05:05 -07:00
Daniel Marjamäki
4f88fdcf4a
Check64Bit: Fixed false positive about returning integer for 'p+(n*80)'
2013-10-08 06:36:45 +02:00
Robert Reif
1959377423
Fixed #4963 (cppcheck and testrunner Visual Studio 2008 build failure)
2013-10-08 05:36:52 +02:00
Daniel Marjamäki
f9cf148012
CheckBool: Skip 'bool' type checking in C code
2013-10-07 18:41:07 +02:00
Daniel Marjamäki
b81de5494e
CheckBool: Fixed false positive for calculation using bool result in rhs
2013-10-07 18:01:08 +02:00
Daniel Marjamäki
d2025363d0
CheckBool: Fix false positive for '(a != boolexpr || c)' if a is a int
2013-10-07 17:44:19 +02:00
Daniel Marjamäki
83f9503839
CheckBool: Fixed false positives for non-bool expressions that contain ! operator
2013-10-07 16:37:51 +02:00
Daniel Marjamäki
023d0e7cb8
Fixed #5072 (False positive: comparisonOfBoolWithInvalidComparator even without explicit bool type)
2013-10-07 16:16:07 +02:00
Daniel Marjamäki
4cd0108b93
Fixed #4976 (False positive: (style) A pointer can not be negative (git/sha1_file.c))
2013-10-06 16:52:27 +02:00
Daniel Marjamäki
0ef1529ba5
Fixed #5005 (false positive: (warning) Assignment of function parameter has no effect outside the function.)
2013-10-06 16:07:27 +02:00