Commit Graph

1508 Commits

Author SHA1 Message Date
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 6acb304ef2 Cleanup: Removed unfinnished checking of std::find 2010-04-03 15:33:13 +02: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
Martin Ettl 0f284b477d coverage report fix: more testcases for mathlib::isInt() added in order to get a better coverage 2010-04-02 22:18:50 +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 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
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
Daniel Marjamäki 4225544c82 Added TODO test case to reduce false negatives for uninitialized class members 2010-04-02 19:10:05 +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
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
Reijo Tomperi a18c964efa astyle fix 2010-03-27 21:41:17 +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
Daniel Marjamäki bef1857221 Preprocessor: Added TODO testcase when using variadic macros 2010-03-24 19:24:53 +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 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
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 89719b023e unit testing: made Tokenizer functions public so they can be unit tested 2010-03-17 22:08:02 +01:00
Daniel Marjamäki 2441a79c7b unit testing: use const_cast instead of defines 2010-03-17 21:58:53 +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 382e41d92a Fixed #1494 (Improve Tokenizer::simplifyKnownVariables to handle for loops better) 2010-03-14 09:57:34 +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 95cbb60974 Fix compiling tests. 2010-03-12 17:21:41 +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 dbc235bd39 Function constness: I don't think it's necessary to show both definition and implementation location. I changed so only the location of the definition is shown. This fixes #1486. 2010-03-09 07:29:03 +01:00
Daniel Marjamäki 770d2ff835 Simplify enum: Fixed segmentation fault if code ends with enum type id 2010-03-07 13:01:56 +01:00
Daniel Marjamäki fa493b7fd1 Fixed #1474 (segmentation fault of cppcheck) 2010-03-07 12:50:45 +01:00
Daniel Marjamäki 7f42ed3ad0 Fixed #1472 (false positive: Data is allocated but not initialized: service) 2010-03-07 09:08:52 +01:00
Reijo Tomperi b88126a669 Fix #1469 (False positive: Resource leak when fclose() is inside while)
http://sourceforge.net/apps/trac/cppcheck/ticket/1469
2010-03-06 16:28:52 +02:00
Daniel Marjamäki fe30c1ca9d Fixed #1432 (false positive: uninitialized variable) 2010-03-06 13:48:43 +01:00
Reijo Tomperi 237fdbc653 Fix #1454 (False positive: arrayindexoutofbounds, static member sharing local name)
http://sourceforge.net/apps/trac/cppcheck/ticket/1454
2010-03-06 14:35:04 +02:00
Robert Reif 7c283d1321 Fixed #1321 (Improve check const-function: function that is not implemented inline can be made const) 2010-03-05 17:06:25 +01:00
Daniel Marjamäki 4bb5272760 Fixed #1466 (false positive: Invalid number of character ({) when these macros are defined: '') 2010-03-04 18:51:25 +01:00
Reijo Tomperi d881fd7a31 Partial fix #1464 (takes too long (days) to process some files)
Fix template functions that return "&T".
http://sourceforge.net/apps/trac/cppcheck/ticket/1464
2010-03-03 23:02:32 +02:00
Daniel Marjamäki e207da18a2 STL: don't warn about the suspicious string::find condition because it's not always a bug 2010-03-03 17:11:31 +01:00
Daniel Marjamäki 6ca4b008d0 null pointer: Fixed better error message for 'possible null pointer' + removed redundant check in our Tokenizer. 2010-02-28 07:26:50 +01:00
Daniel Marjamäki 4407aabe55 STL: suspicious condition when using std::find 2010-02-28 07:04:58 +01:00
Reijo Tomperi 88840e6a08 Fix #1453 (possible infinite loop processing GNU Go's engine/montecarlo.c)
http://sourceforge.net/apps/trac/cppcheck/ticket/1453
2010-02-27 23:47:56 +02:00
Daniel Marjamäki 69d6453ea8 STL: suspicious conditions when using find. Added ok testcases and assert that no error message is written 2010-02-27 21:35:33 +01:00
Daniel Marjamäki 4de700c9de STL: suspicious condition when using find on strings and containers 2010-02-27 21:26:11 +01:00
Daniel Marjamäki 50210857a6 Fixed #1439 (false positive: memory leak when using realloc) 2010-02-27 19:41:14 +01:00
Kimmo Varis 839a81a865 Move build products to Build and BuildTmp folders.
This avoids polluting source folders with created/temp files. Also makes it
easier for installer to pick files from consistently named folders.
2010-02-27 21:15:00 +08:00
Kimmo Varis ae58f54230 Projfiles: Fix preprocessor definitions. 2010-02-27 21:15:00 +08:00
Kimmo Varis 7bab8c3c03 Projfiles: fix test project include paths. 2010-02-27 21:15:00 +08:00
Kimmo Varis 6b07097cf4 Projfiles: Use $IntDir and $OutDir as paths where applicable.
Try to also keep outdir clean of unnecessary files and direct most of build-
time files to intdir.
2010-02-27 21:15:00 +08:00
Daniel Marjamäki a8ee4a03f0 Fixed #1456 (PATCH: Variable hides typedef with same name false positive) 2010-02-27 07:27:51 +01:00
Daniel Marjamäki ce0131a1e6 Fixed #1397 (false positive: Memory leak in while loop) 2010-02-26 22:14:56 +01:00
Reijo Tomperi 9b6336013b Fix #1455 (Preprocessor: Wrong line number in "No pair for character" error)
http://sourceforge.net/apps/trac/cppcheck/ticket/1455
2010-02-26 23:11:23 +02:00
Robert Reif 54bf67e766 Fixed #1456 (PATCH: Variable hides typedef with same name false positive) 2010-02-26 21:43:00 +01:00
Robert Reif f4d600e93b Fixed #1457 (PATCH: Variable hides enumerator with same name false negative) 2010-02-26 21:40:57 +01:00
Reijo Tomperi b35acc1e6b Add TODO test case for #1444 (inline suppression suppress all errors of the same type in a function)
http://sourceforge.net/apps/trac/cppcheck/ticket/1444
2010-02-25 22:55:09 +02:00
Reijo Tomperi 13f8e10c40 Add TODO test cases for #1454 (False positive: arrayindexoutofbounds, static member sharing local name)
http://sourceforge.net/apps/trac/cppcheck/ticket/1454
2010-02-25 22:02:12 +02:00
Reijo Tomperi 23407c7f1d Cleanup test/testtokenize.cpp a bit by putting duplicate code into a function. 2010-02-25 22:00:39 +02:00
Daniel Marjamäki 377d3091a9 Fixed #1452 (Simplify goto better) 2010-02-25 20:03:39 +01:00
Robert Reif 0da133f8a0 Fixed #1451 (false positive: operator = should return reference to self) 2010-02-25 07:26:59 +01:00
Robert Reif f9d444ed52 Fixed #1445 (segfault in Tokenizer::simplifyRedundantParanthesis()) 2010-02-25 07:24:32 +01:00
Reijo Tomperi 01c5bdfc68 Add TODO test case for #1452 (Simplify goto better)
http://sourceforge.net/apps/trac/cppcheck/ticket/1452
2010-02-24 22:55:16 +02:00
Robert Reif 7d8adfb4df Fixed #1449 (segmentation fault of cppcheck) 2010-02-24 17:50:02 +01:00
Robert Reif d9df3d5c6e Fixed #1434 (### Internal error in Cppcheck. Please report it.) 2010-02-23 22:12:55 +01:00
Daniel Marjamäki 40bb5144e1 removed some more cmake files 2010-02-23 20:12:53 +01:00
Daniel Marjamäki 0b2ad2164f Fixed #1442 (false positive: getting offset instead of dereferencing a null pointer) 2010-02-22 21:30:21 +01:00
Daniel Marjamäki 8f4edb5e45 Fixed #1409 (False positive: Buffer access out-of-bounds with strncpy and an array in typedef'ed struct) 2010-02-21 15:23:50 +01:00
Daniel Marjamäki d5611a1a06 Fixed #1426 (false positive: returning LPVOID can be const) 2010-02-21 10:19:28 +01:00
Daniel Marjamäki 459a3bac50 Fixed #1396 (false positive: Resource leak) 2010-02-21 09:47:41 +01:00
Daniel Marjamäki 7a72932078 Tokenizer: simple simplification of array sizes 2010-02-20 18:13:09 +01:00
Daniel Marjamäki e4cc8cf1a0 Fixed #1395 (false positive: Possible null pointer dereference) 2010-02-20 15:50:44 +01:00
Daniel Marjamäki ccef1d6eb5 Fixed #1424 (false positive: unintialized variable) 2010-02-20 13:24:50 +01:00
Daniel Marjamäki 084b21494a Fixed #1422 (false positive: uninitialized variable) 2010-02-20 11:43:53 +01:00
Daniel Marjamäki a6c9a6fc54 Fixed #1407 (false positive memory leak when returning pointer to the allocated memory) 2010-02-20 10:17:45 +01:00
Daniel Marjamäki d0348fa57a Fixed #1403 (false positive: The function can be const) 2010-02-20 09:55:51 +01:00
Daniel Marjamäki 6a03fa604c Fixed #1402 (false positive: uninitialized variable) 2010-02-20 09:35:57 +01:00
Robert Reif 24628013f1 Fixed #1427 (new check: check for typedef name hiding) 2010-02-20 09:07:29 +01:00
Daniel Marjamäki 5e90945486 renamed gui/test.cpp to test/test.cxx 2010-02-19 07:21:16 +01:00
Daniel Marjamäki 375d2b1fcd astyle formatting 2010-02-18 19:55:47 +01:00
Daniel Marjamäki b59d79c303 readded checks for unused variables and unreachable code that were removed in 42c608b6f0 2010-02-18 18:45:13 +01:00
Robert Reif 5c6ec0364d Fixed #1411 (### Internal error in Cppcheck. Please report it.) 2010-02-18 07:24:24 +01:00
Robert Reif 9e61e7dda8 Fixed #1405 (false positive: operator = should return reference t 2010-02-17 22:46:03 +01:00
Robert Reif deb71fc566 Fixed #1405 (false positive: operator = should return reference to itself) 2010-02-17 22:42:08 +01:00
Daniel Marjamäki db2c362604 Fixed #1389 (false positive: uninitialized variable) 2010-02-17 18:10:50 +01:00
Robert Reif f15c408f13 Fixed #1388 (enum token/template parameter confusion - False positive) 2010-02-16 07:33:23 +01:00
Reijo Tomperi e44f0b1b8d Fix #1392 (Segfault in CheckBufferOverrun::checkScope)
http://sourceforge.net/apps/trac/cppcheck/ticket/1392
2010-02-15 23:20:09 +02:00
Monika Lukow e9e5174797 Fixed #1333 (Detect access out of bounds 'for (i = 100; i > 0; --i) a[i] = 0;') 2010-02-14 23:10:15 +01:00
Reijo Tomperi b52fa9451f Fix #1385 (False positive: unsigned division)
http://sourceforge.net/apps/trac/cppcheck/ticket/1385
This also fixes a bug in setVarId(). "unsigned int a" didn't get varid,
untill later when unsigned was simplified away.
2010-02-12 22:24:06 +02:00
Daniel Marjamäki 669fe1b23d Fixed #1382 (False positive: uninitialized variable when using assembly to initialize variable) 2010-02-12 18:15:15 +01:00
Reijo Tomperi 2a78637da7 Fix #1340 (False positive: Array out of bounds for re-initialised array pointer)
http://sourceforge.net/apps/trac/cppcheck/ticket/1340
2010-02-10 23:11:08 +02:00
Daniel Marjamäki 0a6aa0f094 Fixed #1376 (Member variable not initialized in the constructor false positive) 2010-02-10 19:28:51 +01:00
Reijo Tomperi faced1b483 Possibly fix #1369 (Internal error - double-declared enum followed by another enum)
http://sourceforge.net/apps/trac/cppcheck/ticket/1369
Don't include same file twice if one is a/a.h and other is a/../a/a.h
2010-02-09 22:26:15 +02:00
Daniel Marjamäki 18e7813e04 Fixed #1373 (###### If you see this, there is a bug ######) 2010-02-09 18:11:06 +01:00
Reijo Tomperi 45abd2d7fc Fix #1366 (void Tokenizer::simplifyTemplates() --> Abort)
http://sourceforge.net/apps/trac/cppcheck/ticket/1366
2010-02-09 00:16:12 +02:00
Daniel Marjamäki 8853f304af Fixed #1364 (False positive: (error) Possible null pointer dereference) 2010-02-08 18:25:08 +01:00
Reijo Tomperi 7e2e20c2d3 astyle fix 2010-02-08 09:35:53 +02:00
Robert Reif 9591e09dd0 Fixed #1344 (false negative: missing const not found) 2010-02-08 07:25:19 +01:00
Monika Lukow 2d5d060514 Fixed #1094 (Improve check: unusual pointer arithmetic: 'ch+str') 2010-02-07 21:44:11 +01:00
Daniel Marjamäki cd5b95849d Fixed #1361 (### Internal error in Cppcheck. Please report it) 2010-02-07 15:00:19 +01:00
Daniel Marjamäki fb09b2fd37 Fixed #1356 (Double-False positive: uninitialized variable) 2010-02-07 13:34:39 +01:00
Daniel Marjamäki 1b0c81a24b Tokenizer: Fixed bug in setVarId. functions should never have a variable id 2010-02-07 13:04:33 +01:00
Daniel Marjamäki ed8f3bc806 Fixed #1362 (Internal error when using ?-operator and nested {}) 2010-02-07 09:14:59 +01:00