Commit Graph

181 Commits

Author SHA1 Message Date
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 bfb82fe3e1 Cppcheck: Show single 'too many configurations' message if --enable=information hasn't been used and there are too many configurations. 2012-12-26 18:35:49 +01:00
Daniel Marjamäki b107e5e9e8 cppcheckexecutor: removed time info from verbose progress info. the ctime function that is used is not threadsafe. 2012-12-09 09:30:18 +01: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
Daniel Marjamäki 0bbf2ecd0c CLI: output information messages to error report 2012-07-04 18:21:56 +02:00
Daniel Marjamäki 956a37a382 Fixed compiler errors 2012-06-20 17:39:31 +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 772108374e Removed unused variable CppCheck::_errout. 2012-04-08 14:18:13 +02:00
PKEuS e8a458edde Fixed crash when --errorlist is given (#3711) 2012-04-08 10:05:44 +02:00
Simon Martin 3ccdd16b01 Avoid clang warning. 2012-04-07 15:36:45 +02:00
PKEuS 6643e14d3c Avoid copying Settings in CppCheckExecutor 2012-04-06 14:19:26 +02:00
PKEuS c61762f454 Refactorized doAssignement:
- Enhanced performance by directly iterating through the token list instead of index access
- Added more allocation functions
- Simplified code
Replaced avoidable strlen call in cppcheckexecutor.cpp
2012-02-29 20:57:48 +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 b1ff900aaa Some refactorizations 2012-02-18 23:43:51 +01:00
PKEuS 2ba2a4e6ae Some refactorizations 2012-02-18 11:55:05 +01:00
Daniel Marjamäki 112873e876 Revert "Fixed #3450 (CLI --report-progress is currently useless)"
This reverts commit e769fe6294.
2012-01-02 07:42:39 +01:00
Daniel Marjamäki e769fe6294 Fixed #3450 (CLI --report-progress is currently useless) 2012-01-02 07:27:45 +01:00
PKEuS f4703e026a Refactoring various issues in cmdlineparser, cppcheckexecutor, check64bit and tokenize. 2012-01-01 21:17:16 +02:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
PKEuS dca03c3ce2 Remove unnecessary includes
Also add a unit test related to #3427
Also improve the description text in checkclass and remove unused variable.
2011-12-23 23:31:48 +02:00
Daniel Marjamäki 9996d38715 Fix #3277 (Other: attempt to copy-construct an iterator from a singular iterator) 2011-11-11 09:19:59 +01:00
Daniel Marjamäki ed97b62610 Fixed #3275 (Missing includes always reported) 2011-11-06 08:59:07 +01:00
Zhiyuan Zhang 4c3283738b Fixed #3292 (Error in --suppressions-list silently ignores all subsequent command line options) 2011-11-05 18:15:03 +01:00
Reijo Tomperi e989af3fd5 Fix typo "Cpppcheck" 2011-11-05 18:56:40 +02:00
Edoardo Prezioso 9dd3360cd6 Fix some complainted choices made in my older commits.
Note: probably you should do 'make clean' before using 'make' to rebuild it again. Maybe it's me but 'make' reports various errors when linking.
2011-11-01 13:23:47 +01:00
Edoardo Prezioso 433f4640a9 Fix some GCC warnings regarding the sign conversion. 2011-10-30 18:34:49 +01:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Reijo Tomperi 1c9ae6937c Fix compiling on VC++ after previous commit 2011-10-09 21:14:44 +03:00
Reijo Tomperi e87628b72f Filter out duplicate error messages in cli. 2011-10-09 21:03:38 +03:00
Kimmo Varis 06f9d310ce CLI: case-insensitive ignorepath matching in Windows. 2011-10-02 12:02:07 +03:00
Kimmo Varis 9e2dd553fb Add "ExtraVersion" version number information.
The "ExtraVersion" can be used for things like Git commit Id,
release tag (version control), release date etc. If the string
is empty, nothing is printed.
2011-08-11 17:34:59 +03:00
Kimmo Varis 371838b9cb CLI: Warn if user tries to exclude header files.
Filename exclusion (with -i) works only for the source files.
Print a warning if user tries to exclude header file. The warning
instructs user to use --suppress for ignoring warnings from the
header files.
2011-08-06 17:24:10 +03:00
Kimmo Varis e86abfdc5f No unmatched suppressions list in quiet output.
When user wants to see only errors printed (--quiet in CLI) we
must obey that. And not print unmatchedSuppressions list.

Ticket: #2895 (Cannot suppress unmatchedSuppression reports)
2011-08-04 12:04:38 +03:00
Daniel Marjamäki c1138cf7f9 Fixed #2941 (False positive: unused function (individual checking of files)) 2011-07-25 13:25:09 +02:00
Daniel Marjamaki b55147a29e updated error message. --check-includes has been renamed to --check-config 2011-05-04 18:52:03 +02:00
Daniel Marjamäki d998477c69 renamed --check-includes to --check-config 2011-05-02 21:28:33 +02:00
Daniel Marjamäki 8603919b2d Missing includes - normally just report that there are missing includes. The --check-includes can then be used to check what missing includes there are. Ticket: #2719 2011-05-02 14:58:16 +02:00
Kimmo Varis c7d99fe9a7 Remove ErrorLogger::reportStatus() method.
The ErrorLogger::reportStatus() is not lib code interface. The CLI
code does the looping through file list and gives one file at a
time for the core code. Hence lib has no any idea about the
progress and it can't provide such information.

Also the recent commit (6d858b6) caused a GUI build failure by
adding CLI code dependency to GUI. Which is big no-no.

This is admittedly a hack. But it allow us to build all modules
again.
2011-04-27 23:27:02 +03:00
Greg Hewgill 6d858b63a1 Report percentage complete based on file size
This patch makes the (reasonable) assumption that the total size of all checked
files fits in a 'long' type.
2011-04-26 22:26:23 +12:00
Kimmo Varis f240574107 Modify the Cppcheck class to check one file at a time.
Unify usage and API of CppCheck class. Allow only one file checked
at a time, instead of list of files. Clients can then handle file
lists more naturally and as they see fit. Also clients have better
knowledge of how checking status should be handled.

The single-threaded CLI checking was only one using the file list.
Other clients were giving files (to list) one file at a time.
2011-04-24 19:17:52 +03:00
Kimmo Varis 903769a388 CLI: Give files to Cppcheck class one at a time.
When doing single-threaded checking give checked files to Cppcheck
class one file at a time. Like GUI and multithreaded checking
already do. This unifies how we call Cppcheck class from different
clients.
2011-04-24 19:17:52 +03:00
Daniel Marjamäki b7e14223b3 astyle formatting 2011-04-16 12:08:26 +02:00
Stefan Weil 882d4d95a4 CppcheckExecutor: Code cleanups and fixes 2011-04-16 11:19:56 +02:00
Kimmo Varis 139fbf57e0 Ticket #2688 (Missing include path shouldn't exit the program)
Non-existing include path is not a fatal problem requiring exiting
the program. Instead we just print a warning and remove the non-
existing include path from the list.
2011-03-26 18:44:22 +02:00
Daniel Marjamäki 8caf96be63 FileLister: Moved back the code into a single cpp file 2011-03-20 14:25:11 +01:00
Daniel Marjamäki 0ee583e324 Fixed gcc compiler warnings (signedness) 2011-02-16 20:56:02 +01:00
Greg Hewgill 5d74325015 implement unmatchedSuppression information message 2011-02-16 23:02:37 +13:00
Kimmo Varis ffc4bb481b Merge branch 'ignore-paths-cli' 2011-02-02 21:09:22 +02:00
Daniel Marjamäki 9a383388be xml2: added <errors> element 2011-02-02 18:46:07 +01:00
Kimmo Varis 1a83e3ef81 Use different way to remove items from vector.
The way I was using caused a debug error in Visual Studio 2008. Probably
because the iterator got invalidated. So access items as array instead.
2011-02-02 14:37:48 +02:00
Kimmo Varis 6401271ceb Add CLI support for ignoring paths.
Add support for giving list of ignored paths from CLI. This way
user can define paths one doesn't want to check (like generated
code). This first simple implementation only does exact matching,
no support for wildcards etc. And matching is always agains dir
names.

If the filtered dir name is part of the checked filename then the
file is ignored.

Ticket #1690 (Ability to exclude files and directories from checks)
2011-02-02 14:34:04 +02:00
Kimmo Varis a794edd934 Don't stop processing cmd line after --errorlist.
Ticket #2441 (Parsing of command line arguments breaks after --errorlist)

Instead of stopping processing command line options after
--errorlist process them all. This way e.g. --verbose can be given
also after the --errorlist.
2011-01-27 11:14:08 +02:00
Kimmo Varis dcc241a2b4 Don't print "files not found" after showing help.
Fix ticket #2496 (Is error reporting for an unneeded parameter wrong?)

There are several command line options / commands after which we
don't want Cppcheck to even try to open any files. Eg. printing
help or listing errors. So add new attribute for CmdLineParser to
track use of these options and exit before checking files when
the attribute is set.
2011-01-27 10:30:53 +02:00
Daniel Marjamäki 657c22d23b cppcheck: output errorlist to stdout 2011-01-16 17:18:09 +01:00
Kimmo Varis 420099588f Add couple of missing path separator conversions. 2011-01-13 23:20:58 +02:00
Kimmo Varis 846d3dae99 Accept include paths ending with backslash.
Convert include path to use internal path separators when parsing
command line. Convert back to native separators when using paths.

Ticket #2448 (Error in handling -I command line parameter)
2011-01-11 21:04:21 +02:00
Reijo Tomperi 226b605774 Change year 2010 -> 2011 in license texts. 2011-01-09 21:33:36 +02:00
Daniel Marjamäki d316f6005f Fixed #2409 (print a warning if provided path (commandline option -I [PATH]) does not exist) 2011-01-09 09:29:38 +01:00
Daniel Marjamäki 38e7209d26 Fixed #2373 (Using XML2 in --errorlist output) 2010-12-29 12:43:29 +01:00
Daniel Marjamäki af80384ae7 xml2: replace --xml2 with --xmlver=2. Ticket: #2106 2010-12-02 17:32:51 +01:00
Daniel Marjamäki 12c8eeff2c xml2: Added experimental --xml2 result format. Ticket: #2106 2010-12-01 21:24:17 +01:00
Daniel Marjamäki ba7a3b376e Fixed #2167 (Drop linefeeds from error messages) 2010-11-11 19:54:43 +01:00
Daniel Marjamäki 81cac166d6 FileLister: minor cleanup 2010-11-09 19:11:43 +01:00
Daniel Marjamäki 2346ab8839 astyle formatting 2010-10-22 19:58:18 +02:00
Lauri Nurmi 91e66e74d0 Fixed #2099 (Show an error if none of the given paths was found) 2010-10-22 17:09:50 +02:00
Daniel Marjamäki 6dc3073061 CLI: added newline when printing version info 2010-10-08 19:00:06 +02:00
Daniel Marjamäki fed198aafb cmdlineparser: use given settings 2010-09-06 22:35:30 +02:00
Kimmo Varis 45eaebe423 Move CLI command line parsing to own class. 2010-09-05 11:17:31 +03:00
Daniel Marjamäki 6cb7fefdbf Added command line option --report-progress. ticket: #1926 2010-08-12 21:03:33 +02:00
Daniel Marjamäki 5d1e85dde1 CLI: increase delay between progress reports from 1s to 10s 2010-08-08 09:23:13 +02:00
Daniel Marjamäki 11ef2c0a06 Refactoring: Cppcheck::reportProgress needs to call _errorLogger::reportProgress. Ticket: #1625 2010-08-08 08:46:47 +02:00
Kimmo Varis fa0f6edacf Rename ErrorMessage::toText() to ErrorMessage::toString(). 2010-07-14 18:31:05 +03:00
Daniel Marjamäki c718a7c595 astyle: Update to astyle 1.24 2010-04-15 20:08:51 +02:00
Reijo Tomperi 35d2a27b9c Update copyright year in all source files 2010-04-13 22:23:17 +03:00
Reijo Tomperi 9a4cbe0540 Changed CppCheck::parseFromArgs() to return boolean value and reportOut() in case of error.
It used to throw exception and return error message with the exception.
2010-04-11 22:53:21 +03: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
Daniel Marjamäki 90e44bb3bb restructuring the folder structure 2009-10-25 21:20:42 +01:00
Daniel Marjamäki d4f706e040 fixed qmake building with new folder structure 2009-10-25 19:29:10 +01:00
Daniel Marjamäki 09859c1019 refactoring the folder structure 2009-10-25 12:49:06 +01:00