Commit Graph

180 Commits

Author SHA1 Message Date
Daniel Marjamäki 17cf24ed34 Fixed #3643 (Preprocessor: Invalid configuration (macro is used in code)) 2012-07-10 20:29:04 +02:00
Edoardo Prezioso fae40c4782 Change every C version of 'size_t' to C++ 'std::size_t'. 2012-07-09 13:30:18 +02:00
Edoardo Prezioso 3c4ce7b43a Fixed (for real) the preprocessor.cpp(1166) warning in #2123. 2012-07-06 13:17:08 +02:00
PKEuS 2de6ea4627 Incremented version to "1.56 dev" 2012-07-02 11:10:07 -07:00
Daniel Marjamäki 2536746d02 1.55: Set version 2012-06-30 18:08:27 +02:00
Kimmo Varis 68c52ddd69 Refactoring information messages.
Currently the information severity messages are outputted as error
messages with Severity::Information. This causes constant confusion
as people think it as mildest error severity (and rightfully so).
When it was meant to be for printing messages about the checking
procedure itself (like missing header files etc).

So I'm adding a new function for the ErrorLogger for printing these
informative messages. This makes clear the distinction of errors
found from the code and messages related to the checking itself.
It also makes it easier for clients to handle these separately.
2012-06-19 00:16:20 +03:00
PKEuS 1a6e69a80b Fix for problem: "Too many #ifdef configurations - cppcheck will only check 12 of 12" 2012-06-13 10:50:50 -07:00
Edoardo Prezioso eacf74be8d Changed the order of some structures in order to improve, even if for a bit, their padding. 2012-05-14 20:49:03 +02:00
PKEuS 06a77679d4 Refactorizations:
- Added support for pointers in self assignement check
- Removed redundant for loop in checknullpointer.cpp
- Fixed warning about signed/unsigned mismatch in cppcheck.cpp by making Settings::_maxConfig unsigned
2012-05-11 10:38:19 -07:00
PKEuS 11a296cb02 Fixed #2708: Print message before checking and after checking is interrupted if there are too many preprocessor configurations
Removed redundant suppression check because the same check is done inside reportErr again.
2012-05-09 09:54:43 -07:00
PKEuS db914d7185 Fixed compiler errrors and warnings mentioned in #3783 2012-05-07 06:34:47 -07:00
PKEuS 1a5fbd61d2 Splitted class TokenList from Tokenizer 2012-05-05 09:33:26 -07:00
PKEuS 1c3c94dc67 New simplification: Remove 'extern "C"' from C++ code.
Refactorization in cppcheck.cpp: Catch exception as const reference instead of non-const reference.
2012-04-16 16:25:04 +02:00
PKEuS a420a36606 Removed deprecated cmdline options -s, --style, -a, --all, --auto-dealloc, --test-2-pass 2012-04-15 13:10:41 +02:00
PKEuS f1692cdefe Set version to "1.55 dev" 2012-04-15 11:40:14 +02:00
Daniel Marjamäki 3ddbcc7fbe 1.54: updated version numbers 2012-04-15 07:23:26 +02:00
Daniel Marjamäki c7093ca5d6 Tokenizer: allow that time is measured for certain slow simplifications 2012-04-10 13:45:34 +02:00
PKEuS 772108374e Removed unused variable CppCheck::_errout. 2012-04-08 14:18:13 +02:00
Simon Martin 3ccdd16b01 Avoid clang warning. 2012-04-07 15:36:45 +02:00
PKEuS 7de545f0fe Refactorizations:
- Added forgotten initialization of Settings::_relativePaths
- Some PCRE-Rules specific code hidden behind HAVE_RULES
- Use initialization list in ErrorLogger::ErrorMessage::ErrorMessage() and CppCheck::CppCheck
- Avoided unnecessary copies of std::strings in cppcheck.cpp
- Moved "// Alert only about unique errors"-code to make it work in debugFalsePositive mode
2012-04-06 18:16:59 +02:00
PKEuS 6643e14d3c Avoid copying Settings in CppCheckExecutor 2012-04-06 14:19:26 +02:00
Stefan Weil 2ce5b80599 Fix compilation with HAVE_RULES=yes
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2012-03-01 20:07:00 +01:00
PKEuS 1747813a8b Added check for invalid pointer casts (#1255)
Detect sign extension problems when variable is a reference (#3637)
Refactorizations:
- Tokenizer::getFiles returns a reference instead of a pointer, because its guaranteed that no nullpointer is returned
- Remove signed/unsigned in one step for "%type% signed|unsigned"
- Fixed recently introduced compiler warning in symboldatabase.cpp
2012-02-26 11:56:32 +01:00
PKEuS 9a5f66030c Improved unused private function check:
- Fixed #3628
- Added support for friend
Improved symbol database:
- friend scopes are now set
- Added findScopeByName function
Refactorizations:
- Removed some unnecessary "virtual" keywords
- Removed unnecessary _filename member variable, pass it as argument instead
- Made CppCheck::replaceAll static, since it is independant from a specific CppCheck instance, Pass string to be modified by reference
2012-02-24 20:45:56 +01:00
PKEuS 9f42ce91a1 Refactored STL container usage in CLI.
Pathmatcher masks are converted to lowercase only once when instance is created
2012-02-19 17:22:59 +01:00
PKEuS 4b52df675a Some refactorizations 2012-02-18 14:44:04 +01:00
PKEuS 8ea5df62c4 - Improved support for numbers in code:
-- Use MathLib::toLongNumber for conversion in tokenizer (Fix #3610)
-- Handle octal numbers in tokenizer
- Refactorizations in MathLib::toLongNumber and Settings
2012-02-17 15:47:08 +01:00
Daniel Marjamäki 04e4b5d14d lib: fix for my previous commit. If there are no dependencies then don't insert dependencies 2012-02-15 08:13:42 +01:00
Daniel Marjamäki 8f3d511871 lib: allow that file dependencies are taken from Cppcheck after a check 2012-02-15 08:08:28 +01:00
Daniel Marjamäki c33dbb80fb 1.53: Updated version info 2012-02-11 08:17:07 +01:00
Reijo Tomperi 756b8762ab Catch InternalError by reference instead of creating a copy of it. 2012-01-09 18:30:36 +02:00
Reijo Tomperi 194327048a Add InternalError and change MathLib to throw it in case of an error.
- Previously MathLib errors did not provide a filename, but after this change at least source file name should be printed
and if token is provided, also line number should be printed.
- Change also Token to use InternalError
- Modify Cppcheck-class to catch InternalError instead of Token
- Run dmake to update Makefile
2012-01-08 22:19:44 +02:00
Daniel Marjamäki de4a64332e Refactoring: Copy FileLister::acceptFile to Path::acceptFile. Use Path::getFilenameExtension and Path::acceptFile in Tokenizer. Use Path::acceptFile in CppCheck::processFile instead of hardcoded handling. 2012-01-06 17:31:10 +01:00
Daniel Marjamäki 9a102702cb Refactoring: Disable debug warnings when file extension is neither .c nor .cpp. To somewhat prevent that people fix java/c# specific debug warnings. 2012-01-06 16:08:08 +01:00
Daniel Marjamäki 94d220e370 Refactoring: Made Preprocessor::getcode nonstatic 2012-01-06 08:01:50 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
Daniel Marjamäki 93b447f7f6 1.52: Updated version 2011-12-10 12:55:40 +01:00
PKEuS 1bef8d1247 Tokenizer: Code cleanups 2011-12-08 17:42:26 +01:00
Daniel Marjamäki 0dd05e0d56 Fixed #3347 (False positive: unused function (taking address)) 2011-11-21 19:12:54 +01:00
Reijo Tomperi eebd1393ff "Internal error. Token::Match called with varid 0." didn't work when error was in a header file. Fixed that. 2011-11-21 00:41:26 +02:00
Reijo Tomperi 7d7d68b192 Make --debug-fp work with new exception also. 2011-11-21 00:04:09 +02:00
Reijo Tomperi 91e89380c2 astyle fix 2011-11-20 23:43:55 +02:00
Reijo Tomperi e0ea4228cd "Internal error. Token::Match called with varid 0." will now cause check to abort and write a proper error log with filename. Previously filename was empty and format was always xml. 2011-11-20 23:38:37 +02:00
Stefan Weil 785bc3d04b Optimize handling of --append=<file> option (execution time, memory)
Whitespace was removed from the append data for every configuration
and every file: n(configuration) * n(files).

Removing whitespace immediately after the append data was read can
significantly reduce the execution time and memory usage.
It also allows further improvement because copies to the temporary
object appendCode are no longer needed.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
2011-11-15 19:27:36 +01:00
Joshua Beck 56561835f8 Add option to set #ifdef configuration check limit 2011-10-18 19:52:55 -05:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Daniel Marjamäki 5c08979920 1.51: Updated versions 2011-10-08 07:45:39 +02:00
Daniel Marjamäki 939504af3c Cppcheck: allow that 'toomanyconfigs' are suppressed. show these messages by default even though 'information' hasn't been enabled. 2011-08-20 11:20:25 +02:00
Daniel Marjamäki fe78e28d70 Cppcheck: Don't show information messages about interrupted checking unless --enable=information has been given. 2011-08-19 22:32:57 +02:00
Reijo Tomperi dd666b7c1b Add command line option: --debug-fp ... If used, cppcheck will print out the code generating error into output stream.
This is ment to be used for debugging false positive errors in Cppcheck.
Current implementation tries two alternatives. Without all headers or with all headers and prints out the option with
less code. In future versions this could try with individual headers or group of header files.
2011-08-16 22:58:27 +03:00