Commit Graph

9032 Commits

Author SHA1 Message Date
Daniel Marjamäki a3ee72a51d Fixed #4409 (Cppcheck 1.58 dev hangs when checking mhz.c of lmbench3 (attached code)) 2013-01-03 19:14:44 +01:00
Daniel Marjamäki 76c8887f5f tools/reduce: remove cast in function parameter 2013-01-03 18:28:20 +01:00
Daniel Marjamäki 16612d010d tools/reduce: improvements to make it possible to reduce code that hangs 2013-01-03 15:22:54 +01:00
Daniel Marjamäki ded0d50591 Tokenizer: add reportProgress to Tokenizer::simplifyKnownVariables. Ticket: #4409 2013-01-03 15:22:06 +01:00
Daniel Marjamäki 70059c06de Fixed #4456 (std::string::compare(char const*) crash) 2013-01-03 08:44:32 +01:00
Daniel Marjamäki ed803b302b reduce: remove more stuff. unneeded #define , unneeded constructors, unneeded #ifndef etc 2013-01-02 17:08:04 +01:00
Edoardo Prezioso 9455542e81 Update cppcheck translations. 2013-01-02 15:43:54 +01:00
Daniel Marjamäki 1f3628a2fe reduce: remove more code blocks 2013-01-02 15:37:41 +01:00
Daniel Marjamäki 28d5ad9d21 dmake: fixed reduce compilation 2013-01-02 15:36:17 +01:00
Daniel Marjamäki 7f2d9cb7eb dmake: fixed compilation of reduce 2013-01-02 14:43:31 +01:00
Daniel Marjamäki 6e58ed3040 Fixed #4454 (False positive: class member (POD) not initialized (when initialized to 0 in initializer list)) 2013-01-02 13:59:57 +01:00
Daniel Marjamäki 9877b77291 dmake: use 'make reduce' to compile the reduce program 2013-01-02 13:30:06 +01:00
Daniel Marjamäki e0a902e071 tools/reduce: various improvements to remove more code 2013-01-01 20:18:31 +01:00
Reijo Tomperi 5d5f7085bf Updating year 2012 -> 2013 to .cpp and .h files and man page. 2013-01-01 18:29:08 +02:00
Daniel Marjamäki f2f8780504 tools/reduce: better handling of #include 2013-01-01 16:18:06 +01:00
Daniel Marjamäki e824f76ed7 tools/reduce: removing blocks of code that contain #if,#else,#endif 2013-01-01 14:33:32 +01:00
Daniel Marjamäki 6ee32943f2 tools/reduce: speedup, terminate checking when error is found 2013-01-01 13:56:37 +01:00
Robert Reif d2e8ab9c86 Fixed #4302 (Member variable not initialized in public delegate constructor) 2013-01-01 09:53:40 +01:00
Thomas Jarosch 62b05193c4 MC: Split convertFile() function into smaller pieces
Output of build/ stayed the same.
2012-12-31 15:30:27 +01:00
Thomas Jarosch 311630ac1c Match compiler: Python syntax simplification
Output in build/ stayed the same
2012-12-31 15:03:00 +01:00
Thomas Jarosch d366b00eca Add myself to AUTHORS 2012-12-31 14:53:41 +01:00
Thomas Jarosch 51cff0cb9b Match compiler: Speed up Token comparison with string literals. Ticket #4451
"Cache" string literals as C++ std::string objects.
The string length gets cached and so we don't need to
call strlen() on the literals at runtime.
2012-12-31 14:45:16 +01:00
Edoardo Prezioso 6612952dd4 Use 'simple' matching with normal patterns. 2012-12-31 13:30:06 +01:00
Daniel Marjamäki 676b5a15a6 reduce: Added simple command line tool that reduces code for a false positive. 2012-12-31 12:41:36 +01:00
Daniel Marjamäki bf169e0c59 Replaced %name% with %type% 2012-12-31 10:45:37 +01:00
Thomas Jarosch 3c915b534d Match compiler: Collect and cache plain C-strings
Profiler runs with gperftools showed we were spending
a lot of time in strlen() even with compiled match patterns.

If you compare a std::string with a plain C-string,
the comparison operator needs to calculate the length
of the C-string via strlen().

We can avoid this by turning all C-strings into C++ strings,
which cache the string length internally.

The match compiler has been adapted to collect all
C-strings during compilation and aggregate them.

Benchmark on the 'rpm' code base on a Core i7 920 box:

cppcheck without matchcompiler:
real    0m30.977s

cppcheck with previous matchcompiler:
real    0m28.157s

cppcheck with cached C-strings:
real    0m17.823s
2012-12-30 23:24:28 +01:00
Thomas Jarosch fe5ee76165 Match compiler: No need to handle %num% twice 2012-12-30 20:33:49 +01:00
Daniel Marjamäki 4378357d7e Fixed #4372 (Tokenizer misidentifying which function a variable belongs to) 2012-12-29 21:07:41 +01:00
Daniel Marjamäki dde4cc39e5 astyle formatting 2012-12-29 17:13:54 +01:00
Daniel Marjamäki 4d085dd3fd Fixed #4316 (False positive: (constStatement) Redundant code) 2012-12-29 17:13:06 +01:00
Daniel Marjamäki e7aa1ec396 Fixed #4411 (Variable is assigned a value that is never used.) 2012-12-29 12:45:37 +01:00
Daniel Marjamäki 8491df31ca Merge pull request #126 from SimonKagstrom/for-upstream
Misc fixes for the --include= option
2012-12-28 23:58:14 -08:00
Daniel Marjamäki 9af51a75e6 Tokenizer::setVarId: Proper handling of 'void f(struct foobar). Ticket: #4444' 2012-12-29 08:54:39 +01:00
Daniel Marjamäki 38d1b064e8 Symbol database: Add support for unnamed array arguments to functions (#4444) 2012-12-29 08:32:43 +01:00
Robert Reif 07d118dee5 Fixed #4449 (segfault in CheckClass::initializeVarList()) 2012-12-29 08:30:14 +01:00
Thomas Jarosch 1f87c6d669 Fix crash on empty brackets
Relevant parts from the backtrace:
2012-12-28 20:16:51 +01:00
Daniel Marjamäki 1769240e15 Fixed #4022 (false positive: (style) Variable 'sort_entry' is assigned a value that is never used) 2012-12-28 18:18:36 +01:00
Robert Reif 5ba2a300af Symbol database: Improved handling of array arguments (#4444) 2012-12-28 16:28:29 +01:00
Simon Kagstrom 95b51d02c9 path: Add getPathFromFilename (returns the path part of a filename)
E.g.,

  /tmp/a.h -> /tmp/
  a.h ->

etc.
2012-12-28 12:44:26 +01:00
Simon Kagstrom 66a3e5e313 Ticket 4408: cmdlineparser: Improve description of --include= 2012-12-28 12:43:43 +01:00
Simon Kagstrom 350f86fb6a preprocessor: Kill commented out code 2012-12-28 12:43:43 +01:00
Simon Kagstrom 2b698919c4 Ticket #4408: cmdlineparser: Don't force single configuration with --include= 2012-12-28 12:43:43 +01:00
Simon Kagstrom 1e4288fe2e preprocessor: Don't access empty lists
libc aborts with:

/usr/include/c++/4.4/debug/list:256:error: attempt to access an element in
    an empty container.

Objects involved in the operation:
sequence "this" @ 0x0xbfffe5f0 {
  type = NSt7__debug4listISsSaISsEEE;
}

otherwise.
2012-12-28 12:43:43 +01:00
Daniel Marjamäki de2c133f6a Fixed #4426 (False positive: Unitialized variable warning when comparing addresses) 2012-12-28 12:32:15 +01:00
Daniel Marjamäki 6770cc80be Uninitialized variables: Added debug warning for bailout 2012-12-28 11:42:50 +01:00
Thomas Jarosch 78316f02b6 Fix comment about wrong magic number 2012-12-28 11:31:50 +01:00
Thomas Jarosch 4708be09f5 Fixed #4444 (segmentation fault) 2012-12-28 11:15:18 +01:00
Robert Reif bd2f59bdf0 Fixed #4442 (crash of cppcheck while scanning gcc-testsuite (invalid code)) 2012-12-28 08:36:20 +01:00
Daniel Marjamäki b914466285 Uninitialized variables: fixed false positives by bailing out when variable is conditionally initialized and then there is a conditional return. 2012-12-27 18:45:00 +01:00
Daniel Marjamäki bf9b900c30 Tokenizer::setVarId: Fixed problem with initializer lists (#4436) 2012-12-27 18:15:00 +01:00