Commit Graph

9129 Commits

Author SHA1 Message Date
Daniel Marjamäki c59dab2738 uninitialized struct member: changed severity from warning to error since it is UB 2013-01-17 23:18:37 +01:00
Daniel Marjamäki 2c6b383822 Uninitialized member variables: Improvements 2013-01-17 21:04:22 +01:00
Daniel Marjamäki d87d54339d reduce: fix output 2013-01-17 21:02:52 +01:00
Daniel Marjamäki e32ab4bf65 uninitialized struct members: improved fix 2013-01-17 17:21:21 +01:00
Daniel Marjamäki 93fb6b0c6a Fixed #4493 (FP: uninit struct member (struct is assigned)) 2013-01-17 17:01:04 +01:00
Thomas Jarosch b1eec7c6b7 Small refactoring to compile more matches
*** Timing of the test suite ***
Four runs were used to calculate the average run time.

Before: ~1,103s
After: ~1,066s
Speed up: 3,35%

*** Timing of internal projects using STL ***
Before: ~8,301s
After: ~8,207s
Speed up: 1,13%

So the real world speed up is roughly 1%.
2013-01-17 10:26:03 +01:00
Thomas Jarosch c8b619ef86 Let the match compiler catch some more patterns 2013-01-16 22:05:28 +01:00
Thomas Jarosch 4fb6751d08 MC: Enable compiled matches for Token::findmatch() and Token::findsimplematch()
Speed is exactly the same and the --verify mode of the
match compiler ensured everything works as expected.
2013-01-16 21:50:32 +01:00
Thomas Jarosch e22b1f7740 Adapt Tokenizer::simplifyCallingConvention() and Tokenizer::simplifyKeyword() for the match compiler
This little change gives another 6% speed improvement on my box.
(tested with the testsuite and checking the 'rpm' codebase)

The profiler showed we were spending quite some time in
Tokenizer::simplifyCallingConvention(). The multi match
pattern in there is "complex", at least for the on-the-fly parser.
2013-01-16 20:33:01 +01:00
Daniel Marjamäki 5773e69ab1 Uninitialized variables: Add experimental checking of struct members 2013-01-16 20:28:29 +01:00
Daniel Marjamäki 4cd8c7c608 Merge pull request #128 from acmyo/master
Fix compiler warnings and comment/string typos
2013-01-16 08:00:59 -08:00
Daniel Marjamäki 0fb2d309a6 Fixed #4490 (False positive: unused function (function pointer is taken in global scope)) 2013-01-16 16:52:57 +01:00
Andrew C. Martin 4a73c93750 Fix compiler warnings and comment/string typos
- fix g++ warning:

> lib/checkother.cpp:3779: warning: comparison between signed and unsigned integer expressions

 - fix suncc warning (see [everything2](http://everything2.com/title/C%252B%252B%253A+static+extern+%2522C%2522)):

> "lib/checkmemoryleak.cpp", line 578: Warning (Anachronism): Formal argument __compar of type extern "C" int(*)(const void*,const void*) in call to bsearch(const void*, const void*, unsigned long, unsigned long, extern "C" int(*)(const void*,const void*)) is being passed int(*)(const void*,const void*).

- prefer empty() / isEmpty() over "size() > 0" (cases not caught by stlSize)

- fix word misspellings (mostly comments, a few output lines)

  - Parenthesis => Parentheses (both variations were used in the codebase)

  - fix typo and wording ("never alwayw") in gui/test/data/benchmark/simple.cpp's CheckOther::unsignedPositive():

```
-  "An unsigned variable will never alwayw be positive so it is either pointless or "
+  "An unsigned variable can't be negative so it is either pointless or "
```
2013-01-16 07:37:07 -07:00
Daniel Marjamäki 78f3c5f772 Unused functions: Fixed invalid pattern match 2013-01-16 06:43:19 +01:00
Daniel Marjamäki 27eedcd0a3 Merge pull request #127 from rofl0r/master
sanitize the descriptive text displayed for "varFuncNullUB"
2013-01-15 21:34:03 -08:00
rofl0r 623e30d677 fix unit test for varFuncNullUB 2013-01-15 20:45:53 +01:00
Thomas Jarosch f4227967ce Simplify token string access
"internal" check reported:
[lib/tokenize.cpp:6671]: (style) Call to 'Token::tokAt()' followed by 'Token::str()' can be simplified.
2013-01-15 20:37:02 +01:00
Thomas Jarosch 5c8b05ce94 Use Token::simpleMatch() for simple pattern
"internal" check reported:
[lib/symboldatabase.cpp:945]: (warning) Found simple pattern inside Token::Match() call: "> ("
2013-01-15 20:34:11 +01:00
Daniel Marjamäki 2fa35a6f8d Fixed #4429 (unused functions: handle function declarations better) 2013-01-15 17:00:28 +01:00
rofl0r de72ae9f45 sanitize the descriptive text displayed for "varFuncNullUB" 2013-01-14 18:11:16 +01:00
Thomas Jarosch 9f9c654621 MC: Implement verify mode for compiled Token::findmatch patterns 2013-01-14 11:18:33 +01:00
Thomas Jarosch 63e18d6b1c MC: Split _replaceTokenFindMatch() into two small functions 2013-01-14 11:06:59 +01:00
Thomas Jarosch 017783a77e MC: Save one indentation level 2013-01-14 11:06:55 +01:00
Thomas Jarosch 06a7d301e2 MC: Switch to assertEqual function from python's unittest 2013-01-14 11:06:40 +01:00
Thomas Jarosch 3bb8237cdc MC: Turn MatchCompiler tests into python unit test 2013-01-14 11:06:33 +01:00
Daniel Marjamäki d46789ee4a varFuncNullUB: fixed false positive when non-variadic argument is NULL (#4482) 2013-01-14 06:44:52 +01:00
Erik Lax 723d95597b Fixed #4481 (Simplify %str% [ %num% ]) 2013-01-13 20:52:38 +01:00
Daniel Marjamäki f0ce26a2aa Preprocessor: Let the Tokenizer handle NULL 2013-01-13 15:01:31 +01:00
Daniel Marjamäki dc0ecb1082 ThreadExecutor: include sys/select.h for fd_set 2013-01-13 13:21:46 +01:00
Daniel Marjamäki 2e56928834 Fixed #4482 (add test for UB due to usage of NULL in variadic functions) 2013-01-13 12:02:10 +01:00
Erik Lax b538c50856 Fixed #4484 (1.58: new crash for linux kernel code) 2013-01-13 07:57:46 +01:00
PKEuS 57d67c5883 Merge branch 'master' of github.com:danmar/cppcheck 2013-01-12 17:51:00 +01:00
PKEuS 25e07c2466 Updated copyright year in about dialog 2013-01-12 17:50:09 +01:00
PKEuS c62233643a Set version to 1.59 dev 2013-01-12 17:49:09 +01:00
Daniel Marjamäki 2666ff0be7 htdocs: updated download link to windows installer 2013-01-12 17:35:45 +01:00
Daniel Marjamäki 0e82ca764a Makefile: restore to debug mode 2013-01-12 15:40:59 +01:00
Thomas Jarosch c0044122f4 Add self test for _replaceTokenFindMatch 2013-01-12 15:28:38 +01:00
Thomas Jarosch ff9e864a07 Add self test for replaceTokenMatch 2013-01-12 15:28:38 +01:00
Thomas Jarosch a7377f180a Quote output of _assertEquals()
It's easier to detect trailing spaces this way.
2013-01-12 15:28:38 +01:00
Thomas Jarosch 4038d4b562 Place main code into own function 2013-01-12 15:28:38 +01:00
Daniel Marjamäki 75bb4a96cb 1.58: Updated Makefile for release 2013-01-12 14:51:49 +01:00
Daniel Marjamäki 13b266ebcf 1.58: Updated Changelog 2013-01-12 14:50:55 +01:00
Daniel Marjamäki 3057078571 1.58: Set versions 2013-01-12 14:49:58 +01:00
Daniel Marjamäki 7d31c2257d readme: tell about SRCDIR=build 2013-01-12 14:05:03 +01:00
Daniel Marjamäki b5a3ce8cce Manual: Added chapter about --inconclusive 2013-01-12 11:16:57 +01:00
Daniel Marjamäki 290c6a7009 manual: updated date 2013-01-12 10:53:01 +01:00
Daniel Marjamäki 6bf47212c2 Fixed #4479 (GUI tests fail) 2013-01-12 10:44:13 +01:00
Daniel Marjamäki c834bbad10 manual: removed recommendation to not include standard headers from the manual. I can't provide good reasons to not include the standard headers right now. 2013-01-12 09:24:29 +01:00
Daniel Marjamäki b5dba75c3f manual: updated the Severities chapter. No major changes, just tried to make it more clear. 2013-01-11 18:35:37 +01:00
Daniel Marjamäki 7e61d1f2da manual: Removed chapter about exception safety checks. They are enabled by the normal --enable=all. 2013-01-11 16:55:00 +01:00