Commit Graph

991 Commits

Author SHA1 Message Date
Slava Semushin 41e2668138 CheckAutoVariables: don't save and search for local variables with varId 0. 2009-08-16 16:43:04 +07:00
Slava Semushin fc5f4d366e CheckAutoVariables: added braces.
No functional change.
2009-08-16 16:36:07 +07:00
Slava Semushin 743d5331ee CheckAutoVariables(returnPointerToLocalArray): replace std::list to std::set
Use std::set and std::set::find() instead of std::list and
std::find(). First should be faster (runs in the logarithmic time) than
second (runs in linear time).

No functional change.
2009-08-16 16:31:44 +07:00
Slava Semushin 2dccf150ab CheckAutoVariables: change type of vp_list member to std::set.
Change type of vda_list from std::list to std::set. It allows to us
use find() method instead of self-written loop which may be slow.

No functional change.
2009-08-16 16:16:35 +07:00
Slava Semushin 053e6f8b9a CheckAutoVariables: change type of vd_list member to std::set.
Change type of vda_list from std::list to std::set. It allows to us
use find() method instead of self-written loop which may be slow.

No functional change.
2009-08-16 16:10:42 +07:00
Slava Semushin ec81080d0b CheckAutoVariables: change type of vda_list member to std::set.
Change type of vda_list from std::list to std::set. It allows to us
use find() method instead of self-written loop which may be slow.

No functional change.
2009-08-16 16:02:21 +07:00
Slava Semushin 475ef4213b CheckAutoVariables: use varId instead of variable names.
This change similar to be89be8c30 but
for vd_list member.
2009-08-16 15:46:52 +07:00
Slava Semushin be89be8c30 Fixed #590 (False positive: Invalid deallocation when variables have same name)
http://sourceforge.net/apps/trac/cppcheck/ticket/590
2009-08-16 15:27:40 +07:00
Reijo Tomperi f36f3bfae1 line change and encoding fixes 2009-08-15 22:39:57 +03:00
Slava Semushin 19e5fdb087 Fixed #588 (Preprocessor: Sort the configurations)
http://sourceforge.net/apps/trac/cppcheck/ticket/588
2009-08-15 09:35:54 +07:00
danmar dfa8a2e67c Visual C++: Fixed testrunner compilation problems 2009-08-14 12:46:55 +02:00
danmar e9f643f04c Borland C++ Builder: Fixed compilation problems when compiling cppcheck 2009-08-14 12:28:41 +02:00
Reijo Tomperi c8da301f83 fix ticket #586 (Preprocessor: Lines like "#error don't" can cause "no pair for character" errors)
http://sourceforge.net/apps/trac/cppcheck/ticket/586
2009-08-14 00:22:51 +03:00
Daniel Marjamäki 51365c4b9d mathlib: minor fix 2009-08-13 22:31:58 +02:00
danmar 3de825c290 Borland C++ Builder: Fixed compilation and testrunner problems 2009-08-13 22:13:52 +02:00
Reijo Tomperi 4f8a06ed0d Initial work for class and member function/variable list in tokenizer. 2009-08-12 23:50:03 +03:00
Daniel Marjamäki ad4ea01750 Fixed #583 (False positive: the nullpointer check doesn't handle goto properly) 2009-08-12 18:54:52 +02:00
Slava Semushin 6a7624054e Fixed ticket #584 (Tokenizer: don't set varId for class declaration)
http://sourceforge.net/apps/trac/cppcheck/ticket/584
2009-08-12 01:58:49 +07:00
Daniel Marjamäki e7feac506c Refactoring: updated the nullPointer message so it contains the name of the pointer 2009-08-11 17:18:01 +02:00
Daniel Marjamäki ecdbcbce3d Fixed #566 (False positive when assigning the return value of realloc(NULL,..) to a pointer variable holding a freed memory address) 2009-08-10 22:04:28 +02:00
Daniel Marjamäki 045b73c7ec Fixed #582 (Preprocessor: Remove assembler code inside pragmas) 2009-08-10 20:07:55 +02:00
Reijo Tomperi 93604dd344 Fixed ticket #578 (missing virtual destructor not detected)
http://sourceforge.net/apps/trac/cppcheck/ticket/578
2009-08-10 17:58:13 +03:00
Daniel Marjamäki 3331cb834f Hoangtuansu: Fixed #537 (false positive::operator= should return something) 2009-08-09 19:57:48 +02:00
Gianluca Scacco 741073cc21 Style check 2009-08-09 15:44:01 +02:00
Gianluca Scacco ab12b9923d Invalid deallocation check done 2009-08-09 15:40:04 +02:00
Slava Semushin c66103f7bc Fixed ticket #574 (Tokenizer: not assign varId when variable first afer keyword and has long type)
http://sourceforge.net/apps/trac/cppcheck/ticket/574
2009-08-09 15:41:31 +07:00
Slava Semushin 1fd2c0ff28 Fixed ticket #572 (Tokenizer: improve detection of arrays)
http://sourceforge.net/apps/trac/cppcheck/ticket/572
2009-08-09 15:16:37 +07:00
Slava Semushin 5f3baba178 Fixed ticket #573 (False positive of set range check when we dereferencing iterator)
http://sourceforge.net/apps/trac/cppcheck/ticket/573
2009-08-09 02:07:33 +07:00
Slava Semushin eebb1671a5 checkbufferoverrun.cpp: get rid of Match() usage with varid 0. 2009-08-09 01:09:45 +07:00
Slava Semushin 0f96299d87 Fixed ticket #570 (Buffer overrun not detected when sprintf() format string greater then buffer size)
http://sourceforge.net/apps/trac/cppcheck/ticket/570
2009-08-08 21:52:35 +07:00
Slava Semushin 92d4c086ce Fixed ticket #571 (Buffer overrun for sprintf() not detected after first ')' symbol)
http://sourceforge.net/apps/trac/cppcheck/ticket/571
2009-08-08 21:03:10 +07:00
Slava Semushin 50f7fa5828 Fixed ticket #565 (Tokenizer: simplify variable declaraion like 'int z = x >> 16')
http://sourceforge.net/apps/trac/cppcheck/ticket/565
2009-08-08 17:33:07 +07:00
Reijo Tomperi e93179dd9a Improve speed with files containing classes.
E.g. measured speed difference was 1m11.042s --> 0m45.005s with one large test file.
2009-08-08 00:49:37 +03:00
Daniel Marjamäki a0a4008e17 Fixed #525 (false positive: vector range checking with <) 2009-08-07 16:23:28 +02:00
Reijo Tomperi d719606201 Fixed ticket #564 (set variable id for "struct ABC **p")
http://sourceforge.net/apps/trac/cppcheck/ticket/564
2009-08-07 00:31:39 +03:00
Reijo Tomperi 80953633ee Fix ticket #563 (set variable id for **p)
http://sourceforge.net/apps/trac/cppcheck/ticket/563
2009-08-06 23:11:29 +03:00
Daniel Marjamäki 5087dc6b46 Bail out if variable id is 0. This should be reverted when #563 has been fixed 2009-08-06 21:48:22 +02:00
Reijo Tomperi eb691857fd Improve speed a lot for files that have long number lists like = { 0,1,2,3,4, etc. } 2009-08-05 23:02:40 +03:00
Daniel Marjamäki ce8c5b0236 Fixed #555 (False positive: [CuTest.c:25]: (error) Memory leak: len) 2009-08-05 21:18:16 +02:00
Daniel Marjamäki e1beb70f80 Fixed #558 (Tokenizer: Bad simplification of 'for(unsigned i = 0; i < 100; ++i)') 2009-08-05 20:15:48 +02:00
Daniel Marjamäki 1c59e4a51b Fixed #528 (Tokenizer: Simplify: 'if(!(a->x=b()))') 2009-08-05 19:45:05 +02:00
Daniel Marjamäki cb57bd6678 Listing error messages in XML format 2009-08-04 21:36:55 +02:00
Daniel Marjamäki 9e348ca739 Fixed #554 (resource leak false positive) 2009-08-04 21:34:14 +02:00
Daniel Marjamäki 706ba34a6d Refactoring the unit testing 2009-08-04 21:32:14 +02:00
Reijo Tomperi 975e7778ab Fix ticket #531 (false positive about missing virtual destructor)
http://sourceforge.net/apps/trac/cppcheck/ticket/531
2009-08-04 22:23:22 +03:00
Reijo Tomperi 769119c725 Fix ticket #552 (False positive with --all when realloc is used with two variables.)
http://sourceforge.net/apps/trac/cppcheck/ticket/552
2009-08-02 23:30:43 +03:00
Reijo Tomperi 10f6678cf9 TODO test case realloc5 added and "Checkmemoryleak: simplifycode result for" debug info added. 2009-08-02 22:23:47 +03:00
Reijo Tomperi e0f416e52e astyle fix 2009-08-02 22:11:17 +03:00
Slava Semushin be82d09003 src/checkbufferoverrun.cpp: fixed regression. 2009-08-02 20:34:28 +07:00
Slava Semushin 13532cbff7 src/checkbufferoverrun.cpp: don't call Token::Match() for variables with varId 0. 2009-08-02 20:01:59 +07:00
Slava Semushin 822fb93cda Improved "index out of bounds" check.
Corrected 342acaaaf2 commit.
2009-08-02 19:29:45 +07:00
Slava Semushin 35e35b38a7 MathLib: introduce and use calculate() method.
No functional change.
2009-08-02 19:29:30 +07:00
Slava Semushin 98e8e69c8e src/tokenize.cpp: don't call std::string.c_str() for Token::str() argument.
In 4286fdbabb commit I introduce
Token::str() method with std::string argument and now we may get rid
of useless std::string.c_str() calls.

No functional change.
2009-08-02 15:54:46 +07:00
Slava Semushin ed86eda07d Fixed ticket #549 (Tokenizer: improve calculation simplification)
http://sourceforge.net/apps/trac/cppcheck/ticket/549
2009-08-02 15:45:33 +07:00
Slava Semushin 342acaaaf2 Fixed #547 (index out of bounds not detected when addition used as array index)
http://sourceforge.net/apps/trac/cppcheck/ticket/547
2009-08-02 14:59:02 +07:00
Slava Semushin 0445edf6fe Fixed #542 (Tokenizer: allow numbers in templates parameters)
http://sourceforge.net/apps/trac/cppcheck/ticket/542
2009-08-01 23:17:35 +07:00
Slava Semushin 3158e32b7c src/checkstl.cpp(iterators): some corrections.
Corrections for my changes in 12ca70fe5a
and 347802f819 commits.
2009-08-01 21:37:24 +07:00
Slava Semushin 0e2273833e Fixed ticket #539 (Tokenizer: don't replace constants variables with varid 0)
http://sourceforge.net/apps/trac/cppcheck/ticket/539
2009-08-01 20:57:54 +07:00
Daniel Marjamäki b5d172b6e9 preprocessor: fixed problem in Preprocessor::expandMacros when macro argument is for example 'unsigned long' 2009-08-01 14:55:45 +02:00
Daniel Marjamäki e6713e9774 null pointers: fixed a false positive 2009-08-01 11:30:37 +02:00
Daniel Marjamäki b7ffcf53ba Fixed #511 (false positive, memory leak when using 'var = ({});') 2009-07-31 23:42:21 +02:00
Slava Semushin 8588012df7 Fixed #521 (Tokenizer: improve static variable detection)
Also change cppcheck default behavior to don't show "If you see this,
there is a bug" message for each variable without varId. This feature
was very helpful for developers but may annoying users.

http://sourceforge.net/apps/trac/cppcheck/ticket/521
2009-08-01 00:40:36 +07:00
Slava Semushin fa8e1c82f0 Fixed ticket #534 (Segmentation fault when checking VLC sourcecode)
Fixed all valgrind errors.

http://sourceforge.net/apps/trac/cppcheck/ticket/534
2009-07-31 23:06:16 +07:00
Daniel Marjamäki 2d9e4e1a73 null pointers: detect when there are possible null pointer dereferencing when looping through a linked list both in inner and outer loops at the same time 2009-07-31 10:49:43 +02:00
Slava Semushin 347802f819 Fixed ticket #503 (Dereferencing after erase() not work if we try to get access to member)
http://sourceforge.net/apps/trac/cppcheck/ticket/503
2009-07-31 00:49:38 +07:00
Slava Semushin 5db677bc30 Fixed ticket #523 (Tokenizer: set varId for types with long namespaces)
FIXME: skip namespaces by the best way.

http://sourceforge.net/apps/trac/cppcheck/ticket/533
2009-07-31 00:40:41 +07:00
Slava Semushin 681b836389 Fixed ticket #532 (Tokenizer: set varId for types which have comma in template parameter)
http://sourceforge.net/apps/trac/cppcheck/ticket/532
2009-07-31 00:25:26 +07:00
Slava Semushin 12ca70fe5a src/checkstl.cpp(iterators): skip already processed tokens.
No functional change.
2009-07-30 23:57:58 +07:00
Slava Semushin a1a4577a7c src/checkstl.cpp(iterators): simplify condition. 2009-07-30 23:49:04 +07:00
Slava Semushin 46a386ba83 src/checkstl.cpp(iterators): fixed coding mistake. 2009-07-30 23:37:39 +07:00
Reijo Tomperi c9b34706f9 include <ctime> for clock_t (fix compile problem) 2009-07-30 13:31:47 +03:00
Daniel Marjamäki d06e669017 Preprocessor: Speedup of the match_cfg_def function 2009-07-30 10:10:34 +02:00
Reijo Tomperi b56fdb83da Fixed ticket #529 (Tokenizer: simplify if((x==0)))
http://sourceforge.net/apps/trac/cppcheck/ticket/529
2009-07-30 00:37:01 +03:00
Daniel Marjamäki 050b85c5eb memory leak for struct member: fixed false positive when the struct pointer is stored away 2009-07-29 11:38:20 +02:00
Daniel Marjamäki 4e66dc105e null pointers: Fixed false positive when 'do' are used 2009-07-29 11:17:22 +02:00
Slava Semushin 367efe31ea Fixed ticket #524 (Containers range check shouldn't stop at first founded error)
http://sourceforge.net/apps/trac/cppcheck/ticket/524
2009-07-29 03:55:23 +07:00
Slava Semushin 9bf80cb53b src/checkstl.cpp(stlBoundries): simplify condition.
No functional change.
2009-07-29 03:23:23 +07:00
Slava Semushin 8b0c1daf98 Fixed ticket #522 (Tokenizer: recognize comma in container with STL type declaration)
http://sourceforge.net/apps/trac/cppcheck/ticket/522
2009-07-29 02:46:33 +07:00
Slava Semushin 524b0cd9b8 src/checkstl.cpp(iterators): reduce indentation.
No functional change.
2009-07-29 01:05:00 +07:00
Slava Semushin f50aa1e188 Fixed ticket #520 (Tokenizer: properly set varId for containers with STL types)
http://sourceforge.net/apps/trac/cppcheck/ticket/520
2009-07-29 00:54:13 +07:00
Slava Semushin c8caefa94c Fixed ticket #519 (Tokenizer converts commas in for-loops)
http://sourceforge.net/apps/trac/cppcheck/ticket/519
2009-07-28 23:40:15 +07:00
Slava Semushin 600f3a834d Fixed ticket #514 (false positive:: memory leak when using comma near delete[])
http://sourceforge.net/apps/trac/cppcheck/ticket/514
2009-07-28 02:13:08 +07:00
Slava Semushin 82ae0e305b checkautovariables: added newlines to make code more readable.
No code change.
2009-07-28 00:34:17 +07:00
Slava Semushin bb4b2b707c Fixed ticket #517 (False positive for extern variables: return of the address of an auto-variable)
http://sourceforge.net/apps/trac/cppcheck/ticket/517
2009-07-28 00:32:01 +07:00
Slava Semushin 65d6bce165 Replace Match() to operator==() from std::string.
No functional change.
2009-07-28 00:13:44 +07:00
Slava Semushin 5ce151983e Replace simpleMatch() to operator==() from std::string.
No functional change.
2009-07-28 00:13:11 +07:00
Slava Semushin 1ac496e707 src/checkautovariables.cpp(autoVariables): simplify condition.
No functional change.
2009-07-28 00:12:05 +07:00
Slava Semushin 5ff88d7e47 src/checkautovariables.cpp: assign default value to std::string during object creation.
No functional change.
2009-07-28 00:11:21 +07:00
Daniel Marjamäki 55db301b8c gcc: added an option '--showtime' => show some simple timing information 2009-07-27 14:41:34 +02:00
Reijo Tomperi 0a7a4a9d55 Update to ticket #265 (Log a warning when an include file is not found)
Only warn about "foo.h", don't warn about <foo.h>
http://sourceforge.net/apps/trac/cppcheck/ticket/265
2009-07-26 23:15:29 +03:00
Daniel Marjamäki b4a6d74e42 astyle formatting 2009-07-26 22:13:08 +02:00
Slava Semushin 6c022798ea Fixed ticket #499 (buffer overflow not detected when using macros)
sprintf() buffer overrun detection works wrong due to typo (since time
when it was added in commit a604f56f19).

Also reports buffer overrun when sprintf() writes bytes equal to
buffer size -- in this case off-by-one error appears.

http://sourceforge.net/apps/trac/cppcheck/ticket/499
2009-07-26 19:29:46 +07:00
Slava Semushin a73346e889 Fixed ticket #496 (Tokenizer: simplify statements with "," better)
https://sourceforge.net/apps/trac/cppcheck/ticket/496
2009-07-26 18:03:11 +07:00
Daniel Marjamäki ea49b433ec Fixed #506 (###### If you see this, there is a bug ###### Token::Match()) 2009-07-26 11:46:00 +02:00
Reijo Tomperi 25d991d948 Removed some debug output which should not be on and cleaned up a little. 2009-07-26 00:16:18 +03:00
Reijo Tomperi a07b7635c0 Fix ticket #265 (Log a warning when an include file is not found)
http://sourceforge.net/apps/trac/cppcheck/ticket/265
2009-07-25 22:10:30 +03:00
Daniel Marjamäki a6d696bf40 Fixed #504 (false positive: null pointer dereference) 2009-07-25 20:36:02 +02:00
Daniel Marjamäki 321106c39e speedup of CheckOther::postIncrement 2009-07-25 19:36:57 +02:00
Daniel Marjamäki 2544bd8805 astyle formatting 2009-07-25 16:27:18 +02:00
Daniel Marjamäki f877cd2db1 Preprocessor: Added todo test case for better evaluation of #if conditions 2009-07-25 16:22:42 +02:00
Daniel Marjamäki dacaff824c Fixed #501 (Preprocessor should read open configurations that are defined within the file) 2009-07-25 13:58:34 +02:00
Slava Semushin 5f4c83a25e src/checkother.cpp: simplify condition a bit.
No functional change.
2009-07-25 18:23:13 +07:00
Slava Semushin 8643936e0c Fixed ticket #500 (Tokenizer: simplify the "(p != NULL)" conditions)
Also teach simplifyIfNot() to handle variables like Foo::var.

https://sourceforge.net/apps/trac/cppcheck/ticket/500
2009-07-25 18:23:03 +07:00
booga 9fa8c0ee9c astyle FTW (should have read about that sooner) 2009-07-24 19:23:30 -04:00
booga 52e2e775b2 Fix #476 STL Container checks.
Fix #473 Add post increment check for STL objects and Classes.
2009-07-24 18:36:15 -04:00
Daniel Marjamäki 9136d8cf80 Tokenizer: simplify return statements - remove redundant parantheses 2009-07-24 21:55:35 +02:00
Daniel Marjamäki 6bb85703f6 memory leaks: fixed false positive for struct members - better handling of if/else 2009-07-24 09:05:40 +02:00
Daniel Marjamäki 5b81c92a14 null pointers: fixed false positives when checking if pointer is null at many locations (#485) 2009-07-23 19:59:29 +02:00
Daniel Marjamäki 06c8ff9d0d null pointers: fixed false positives (#49) 2009-07-23 19:02:14 +02:00
Daniel Marjamäki 565ac2fca6 Fixed #493 (Memory leak: False positive when using the exit(0)) 2009-07-23 16:30:30 +02:00
Daniel Marjamäki d0f1d885ed null pointers: dereferencing a pointer and then checking if it's null (#49) 2009-07-23 14:13:46 +02:00
Daniel Marjamäki 024778d6eb tokenizer: simplify '?:' better when the condition is always true 2009-07-23 10:12:02 +02:00
Daniel Marjamäki 9b2dd8c7eb Preprocessor: Better evaluation of conditions such as '#if defined A || defined B' (#469) 2009-07-22 20:11:27 +02:00
Daniel Marjamäki 62f681094f tokenizer: added todo for simplifying '(true?x:y)' => '(x)' 2009-07-22 19:39:31 +02:00
Daniel Marjamäki 6fecd858e3 Fixed #469 (Preprocessor should read open configurations that are defined within the file) 2009-07-22 18:47:50 +02:00
Daniel Marjamäki 1d514e1afe Fixed #497 (Templates are not expanded correctly) 2009-07-22 13:29:42 +02:00
Daniel Marjamäki 3243933c90 Fixed #494 (False positives of checking leaks struct members)
Better handling of function calls
2009-07-22 08:30:51 +02:00
Daniel Marjamäki ba36c9426b null pointers: better checking when dereferencing pointer and then checking if it is null (#485) 2009-07-21 17:00:11 +02:00
Daniel Marjamäki 6f646246ee dereferencing deallocated memory: it is ok to take the address to deallocated memory but it is not ok to dereference the address 2009-07-21 13:04:13 +02:00
Daniel Marjamäki 45f8560537 invalid pointer usage: broke out CheckOther::invalidPointer from the CheckOther::nullPointer (#485) 2009-07-21 12:09:58 +02:00
Daniel Marjamäki ce595dd5c7 Merge branch 'master' of git@github.com:danmar/cppcheck 2009-07-21 07:41:43 +02:00
Reijo Tomperi d2278b5ce0 Fix some of the issues from #478 (Warnings in Visual Studio build with -W4)
http://sourceforge.net/apps/trac/cppcheck/ticket/478
2009-07-20 23:24:23 +03:00
Reijo Tomperi 973bb164ea Fix ticket #486 (C-style pointer casting misses const pointers)
http://sourceforge.net/apps/trac/cppcheck/ticket/486
2009-07-20 22:52:27 +03:00
Daniel Marjamäki 0e208eb52f null pointer dereferencing: fixed another false positive (#485) 2009-07-20 19:59:55 +02:00
Daniel Marjamäki 05a1c50ff2 null pointer dereferencing: removed a few false positives in the new check that I added (#485) 2009-07-20 19:30:33 +02:00
Daniel Marjamäki 324f12a103 fix bug in previous commit that fixed #485 2009-07-20 19:10:33 +02:00
Daniel Marjamäki b7ba49114c Fixed #485 (detect when code is checking for null after dereferencing) 2009-07-20 18:53:41 +02:00
Daniel Marjamäki f0afdf3582 preprocessor: Fixed hanging in Preprocessor::expandMacros when trying to replace all '__VA_ARGS__' with '__VA_ARGS__' 2009-07-20 15:42:40 +02:00
Daniel Marjamäki 74699cab66 memory leak for struct member: made the checking more sensitive. Skip bail-out execution paths were the member is properly deallocated 2009-07-20 14:39:24 +02:00
Daniel Marjamäki ddaea3244d memleak: implemented simple checking for leaking struct members 2009-07-19 16:51:31 +02:00
Daniel Marjamäki ffac9281c4 astyle formatting 2009-07-18 20:35:22 +02:00
Slava Semushin 2ba0897ecb src/checkmemoryleak.cpp: added fchmod() function to white list. 2009-07-18 23:48:48 +07:00
Slava Semushin d3490abd64 Finally fixed ticket #284 (style check: redundant condition improvement)
http://sourceforge.net/apps/trac/cppcheck/ticket/284
2009-07-18 21:42:08 +07:00
Slava Semushin a0a526a205 Fixed ticket #464 (resource leak not detected when getc is used on the file handle)
http://sourceforge.net/apps/trac/cppcheck/ticket/464
2009-07-18 18:32:55 +07:00
Slava Semushin 53c120c701 Fixed ticket #479 (varId not assigned to reference to standart container)
http://sourceforge.net/apps/trac/cppcheck/ticket/479
2009-07-18 17:41:46 +07:00
Kimmo Varis 861774575d Enable more warnings in QMake-generated makefiles.
Use same warning levels for GCC than in original makefile. Use W4 level for Visual Studio.
2009-07-18 13:10:24 +03:00
Kimmo Varis 4622f9891c Merge branch 'master' of git@github.com:danmar/cppcheck 2009-07-18 11:26:15 +03:00
Kimmo Varis 180a04316d Fix couple of doxygen errors and warnings. 2009-07-18 11:25:22 +03:00
Daniel Marjamäki 2ccc01f5ed tokenizer: improved the Tokenizer::simplifyIfNot 2009-07-18 10:18:46 +02:00
Daniel Marjamäki b4c3ed78b4 astyle formatting 2009-07-18 09:11:02 +02:00
Slava Semushin 5dea30519c Fixed ticket #459 (false positive::Member variable not initialized in constructor)
http://sourceforge.net/apps/trac/cppcheck/ticket/459
2009-07-17 23:50:49 +07:00
Daniel Marjamäki 7df3670128 doc: updated doxygen comments. three groups where created - 'GUI', 'Core' and 'Checks' 2009-07-17 10:49:01 +02:00
Daniel Marjamäki 968a6bdd2d doc: changed the doxygen comments for the mainpage 2009-07-16 15:32:07 +02:00
Vesa Pikki 962757c257 Added support for checking files via commandline arguments. 2009-07-16 08:20:29 +03:00
Daniel Marjamäki 54f676177e doxygen: added a todo to simplify 'for' loops better in the tokenizer 2009-07-14 15:30:23 +02:00
Kimmo Varis 40ccd4d1ac Add QMake project files for core and tests.
Ticket #472 (QMake project file to build cppcheck core).
2009-07-14 14:36:05 +03:00
Daniel Marjamäki 456c20b705 fixed todo test case - detect iterator usage after push_front|push_back 2009-07-14 12:40:47 +02:00
Daniel Marjamäki 69b1df3bb8 tokenizer: simplify the '?:' operator 2009-07-14 12:06:38 +02:00
Daniel Marjamäki 4f2520bef3 doxygen: made the todos visible in the doxygen output 2009-07-14 08:17:12 +02:00
Daniel Marjamäki 17008879ac minor refactoring: header cleanup. use forward declarations instead of includes 2009-07-13 19:11:31 +02:00
Daniel Marjamäki 18f9e05f5a refactoring: Renamed checking classes 2009-07-13 16:00:15 +02:00
Kimmo Varis 2ee8be9f7f Merge branch 'master' of git@github.com:danmar/cppcheck 2009-07-13 16:52:06 +03:00
Kimmo Varis 6393498966 Astyle fixes. 2009-07-13 16:51:35 +03:00
Daniel Marjamäki 2a8fa6d19c astyle formatting 2009-07-13 15:50:54 +02:00
Daniel Marjamäki 913789605f refactoring: Refactoring of the leak-checking classes 2009-07-13 15:07:26 +02:00
Daniel Marjamäki f7cb7da560 doxygen: updated a few comments 2009-07-13 13:35:33 +02:00
Kimmo Varis 7491200d71 Merge branch 'master' of git@github.com:danmar/cppcheck 2009-07-13 11:40:40 +03:00
Kimmo Varis d88cf4d3e4 Pave a way for Windows Unicode builds.
Use UNICODE preprocessor define instead of QT_CORE_LIB when determining whether to use Ansi or Unicode data and functions. This only applies to Windows.
2009-07-13 11:39:46 +03:00
Daniel Marjamäki 7d35447d80 refactoring: renamed the severity "all" to "possible error" 2009-07-13 10:16:31 +02:00
Daniel Marjamäki 11bc5195b8 cleanup: continued with the removing of the security. Some more work is needed but now everything compiles and runs at least. 2009-07-12 22:21:49 +02:00
Daniel Marjamäki 2961f29b57 doc: add link 2009-07-12 21:51:57 +02:00
Daniel Marjamäki 03f3ee62a0 cleanup: removed deprecated files. security checking and errmsg 2009-07-12 19:18:38 +02:00
Daniel Marjamäki 112ffd81fd updated version to 1.34 2009-07-12 16:09:22 +02:00
Daniel Marjamäki b86b07827a unused private functions: don't check classes declared in header files unless it is known that their whole implementation is seen 2009-07-12 14:23:01 +02:00
Daniel Marjamäki 6a76243e9f doxygen: wrote a simple text for the mainpage 2009-07-11 16:44:04 +02:00
Daniel Marjamäki 36896e1ca0 better description for the message with id strncatUsage 2009-07-11 12:16:38 +02:00
Daniel Marjamäki 59372199e3 Revert "cppcheck: Now it's possible to change the output format, for example to a visual studio compliant format"
This reverts commit 91a8dbd7b9.
2009-07-10 22:38:26 +02:00
Daniel Marjamäki bd68837866 refactoring: minor refactorings and added some doxygen comments 2009-07-08 17:14:34 +02:00
Daniel Marjamäki 91a8dbd7b9 cppcheck: Now it's possible to change the output format, for example to a visual studio compliant format 2009-07-08 14:38:13 +02:00
Daniel Marjamäki 89115bd417 doc: added more information when '--verbose' is used for these error messages:
* dangerous usage of erase
 * overlapping data buffer
2009-07-08 12:57:36 +02:00
Daniel Marjamäki 2a02041fd8 memleak: fixed todo test case 2009-07-07 15:22:37 +02:00
Daniel Marjamäki ddc1ad7d4d Fixed #431 (Unused private function, wrong line when two functions with same name) 2009-07-07 08:55:14 +02:00
Daniel Marjamäki 9d1d7ebf8d Fixed #382 (False positive: public function flagged as 'Unused private function') 2009-07-07 08:30:23 +02:00
Daniel Marjamäki 9beb73824b Fixed #446 (memory leak false positive when variable is static) 2009-07-06 12:20:13 +02:00
Daniel Marjamäki a6ac747830 tokenizer: Don't simplify declarations of static variables 2009-07-06 11:45:14 +02:00
Reijo Tomperi 8b0e481d46 Refactoring: Rename member functions to follow naming guidelines. 2009-07-05 23:16:43 +03:00
Reijo Tomperi f676deb208 Test case improvement, unused function removed from tokenizer. 2009-07-05 22:37:53 +03:00
Reijo Tomperi e858ab2f0d Fix ticket #457 (False positive: Member variable not assigned a value in copy constructor)
http://sourceforge.net/apps/trac/cppcheck/ticket/457
Simplify "a = 0, b = 0;" into "a = 0; b = 0;"
2009-07-05 21:29:09 +03:00
Kimmo Varis 3132041de3 Move include paths list to Settings class so we can set include paths from GUI. 2009-07-04 01:23:37 +03:00
Reijo Tomperi 26358debcf Fix ticket #448 (false positive:: resource leak)
http://sourceforge.net/apps/trac/cppcheck/ticket/448
Tokenizer improved to simplify "if( (p)==-1 )"
2009-07-03 21:57:44 +03:00
Reijo Tomperi b2474fd980 Fix ticket #452 (Failure to detect "member var not initialized in constructor" if class inherits)
http://sourceforge.net/apps/trac/cppcheck/ticket/452
2009-07-03 21:22:14 +03:00
Reijo Tomperi ea0035ec3a Fix ticket #434 (Unused function gets reported dozens of times)
http://sourceforge.net/apps/trac/cppcheck/ticket/434
Using --unused-functions with -j will now print out error message:
"cppcheck: error: --unused-functions can't be used with -j option."
2009-07-02 23:29:52 +03:00
Reijo Tomperi 751a31ed91 Fix ticket #445 (simple to avoid false positive for buffer overflow)
http://sourceforge.net/apps/trac/cppcheck/ticket/445
Simple bailout in case "if" is found inside the for-loop.
2009-06-30 00:42:46 +03:00
Daniel Marjamäki 7ec8e2396f Fix ticket #267 (Glued define and define name in output text)
The handling of ifdef configurations where rewritten. Either a
configuration is handled properly or it is not handled at all.
2009-06-26 13:19:55 +02:00
Daniel Marjamäki 61f4a29758 minor fix of test case 2009-06-23 20:40:27 +02:00
Daniel Marjamäki 7f8b40d135 calling unknown function -> use 2009-06-23 20:37:34 +02:00
Reijo Tomperi bdf1987cc4 Fix ticket #435 (False positive: Invalid number of character when ({}) is used in code)
http://sourceforge.net/apps/trac/cppcheck/ticket/435
2009-06-22 23:54:11 +03:00
Kimmo Varis 4b1f300660 Merge branch 'master' of git@github.com:danmar/cppcheck 2009-06-22 11:58:15 +03:00
Kimmo Varis 1aafeebe7b GUI: Add support for project files.
GUI reads per-project settings (automatically deallocated classes) from XML project file. The project file format is described in projectfile.txt. Example project file is added for gui.

See also forum discussion at:
https://sourceforge.net/apps/phpbb/cppcheck/viewtopic.php?f=3&t=46
2009-06-22 11:57:17 +03:00
Daniel Marjamäki 5c36d33943 astyle formatting 2009-06-21 21:03:58 +02:00
Daniel Marjamäki 5b5352226c doc: simplified the documentation for autovariables a bit 2009-06-21 21:03:21 +02:00
Slava Semushin 13e805f332 Fixed ticket #399 (Add detection for resource leaks after open() usage)
http://sourceforge.net/apps/trac/cppcheck/ticket/399
2009-06-21 22:01:43 +07:00
Daniel Marjamäki 8715ba1458 CheckMemoryLeakInFunction: More sensitive checking when the code calls an unknown function 2009-06-21 14:12:59 +02:00
Daniel Marjamäki f28dec1f5a detect memory leak when all is given when calling an unknown function 2009-06-21 13:48:39 +02:00
Daniel Marjamäki a0ba52ccf1 Preprocessor: Replace "#if !defined(A)" with "#ifndef A" 2009-06-21 08:03:42 +02:00
Reijo Tomperi ac6e7b40e5 Fix ticket #426 (Problem with include)
http://sourceforge.net/apps/trac/cppcheck/ticket/426
2009-06-20 23:13:19 +03:00
Daniel Marjamäki 8a3ec4549b Fixed #425 (False positive: usage of char variable.. c = c & 0x03)
Using char variables in bit operations are ok if:
 * the result is stored in a char
 * the variable is and'ed with a number that is less than 0x100
2009-06-20 19:24:58 +02:00
Daniel Marjamäki d1d9c9a9c9 CheckMemoryLeakInClass: Only show the memory leak message when --all is used 2009-06-20 14:17:56 +02:00
Daniel Marjamäki 453a5cdd47 Fixed ticket #411 (false positive: resource leak in while loop) 2009-06-20 13:58:30 +02:00
Kimmo Varis af994d23e1 Doxygen fixes. Wrong parameter names etc. 2009-06-20 12:54:49 +03:00