Commit Graph

235 Commits

Author SHA1 Message Date
Joshua Beck 56561835f8 Add option to set #ifdef configuration check limit 2011-10-18 19:52:55 -05:00
Daniel Marjamäki 618379ffd7 cli: updated help text for --std option 2011-10-16 15:32:40 +02:00
PKEuS f8074b71d2 Fixed #2470 (False negative: Possible null pointer dereference (C++0x keyword 'nullptr')) 2011-10-16 12:54:58 +02:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Marek Zmysłowski 307dd00efb Fixed #3072 (improve check: deprecated function alloca) 2011-10-06 08:10:51 +02:00
Joshua Beck 9583394eba Fix test and add info to -h output. 2011-09-27 01:02:58 -05:00
Joshua Beck 240ba0118a Added support for reading file lists from stdin 2011-09-26 19:19:01 -05:00
Robert Reif f97424b242 start adding Windows ASCII TCHAR conversion support 2011-09-24 14:51:03 -04:00
Robert Reif 3f364a3b2f fix width of platform help text 2011-09-19 07:31:09 -04:00
Robert Reif b5d22fda0d fix #2888 (Allow defining sizes of base types) 2011-09-17 19:40:52 -04:00
Daniel Marjamäki e8daaa69d6 CLI: --enable=style has always been the same as --enable=style,portability,performance so keep it that way. Ticket #3074 2011-09-03 17:25:39 +02:00
Daniel Marjamäki d23c58d387 enable: break out 'performance' and 'portability' from the 'style' id. Ticket: #3074 2011-09-03 15:30:30 +02:00
Daniel Marjamäki 8bc7b5c5b9 cmdlineparser: removed BOM 2011-08-18 23:46:31 +02:00
Daniel Marjamaki 232007b3c0 --std=posix : simplified help text. might still need further updates 2011-08-17 22:19:19 +02:00
Daniel Marjamäki afed93d7d6 Command line: Added --std option. Right now only --std=posix is possible but other options might be added later. 2011-08-17 20:08:55 +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
Daniel Marjamäki 01b9c0707d Settings: Removed the --enable=posix option. Ticket: #2949 2011-08-14 09:45:53 +02:00
Kimmo Varis 04d4215116 CLI: Fix misalign of "posix" in help text.
Ticket: #2992 (Little misalignment of '* posix' by one space in CLI command help)
2011-08-11 17:01:13 +03:00
Kimmo Varis 1b6dbedd98 CLI: Fix word-wrapping of the help text. 2011-08-11 15:54:20 +03:00
Kimmo Varis d93e741092 CLI: Reword the help text for -i.
New help text emphasizes we are ignoring/excluding source files.
The header files (include via source files) are not touched.

Ticket: #2965 (CLI: need better description for -i option (applies only to source files))
2011-08-11 15:47:34 +03:00
Daniel Marjamäki 01ae5fb593 help: clarify --suppress a little in the --help output. Ticket: #2964 2011-08-06 17:09:49 +02:00
Kimmo Varis b976445be7 CLI: Strict check if exclude path is file.
Initially I added logic that checked if excluded path was a file
we would accept. This works for source files, but when file with
"unknown" extension was given it was determined as a directory
name and ending slash was added. E.g. -ifile.h would end up
having ignored path file.h/.

This commit adds per-platform checks if the path points to the
file and if the file also exists.
2011-08-06 16:47:57 +03:00
Kimmo Varis 57a51128a4 CLI: Couple of messages missing cppcheck-prefix. 2011-08-04 23:45:50 +03:00
Kimmo Varis a9153dc317 CLI print warning for deprecated options.
We don't want to keep these deprecated options for ever. So lets
print a clear warning for the users and give also specific release
number when they will be removed. Users have a plenty of time to
update their scripts and environments before removal.

Ticket: #2515 (Print warning for deprecated command line options)
2011-08-04 23:39:47 +03:00
Kimmo Varis f4950ea836 CLI: Rename --posix to --enable=posix.
Ticket: #2949 (new check: (style) finding non-reentrant functions)
Ticket: #2952 (CLI option --posix is wrong)
2011-08-03 10:28:36 +03:00
Kimmo Varis a50f75ef86 Add --posix CLI option.
Part of ticket #2949 (new check: (style) finding non-reentrant functions)
2011-07-29 20:17:02 +03:00
Daniel Marjamäki c4c4994d9e cmdlineparser: changed unusedFunctions to unusedFunction to make it work 2011-07-20 18:38:53 +02:00
Daniel Marjamäki c5064e4591 Cmdlineparser: Removed deprecated flag --unused-functions 2011-07-20 06:59:27 +02:00
Kimmo Varis 0db45a30e5 CLI: Improve and clarify help text. 2011-07-16 11:19:35 +03:00
Daniel Marjamäki d998477c69 renamed --check-includes to --check-config 2011-05-02 21:28:33 +02:00
seb777 aa85866bc0 add include-header to use EXIT_FAILURE 2011-05-02 19:56:35 +02:00
Daniel Marjamäki d7927bbb61 update help screen about --check-includes 2011-05-02 18:49:40 +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
Ville Skyttä 5144b0e657 cmdlineparser: Update list of file extensions, expand EXIT_FAILURE, don't list --rule* if built without support for rules. Ticket: #2761 2011-05-01 11:44:47 +02:00
Daniel Marjamäki 1178d47a9b --inconclusive : Added command line flag that enable inconclusive checking. It is added for experimental purposes. 2011-04-10 12:52:59 +02:00
Kimmo Varis 38f5267ba8 CLI: Simplify ignore paths.
Fixes #2656 (-i Give path to ignore does not ignore if start of the
path is different than checked path)

Simplify paths given as -i options. This makes it easier to match
the paths as simplifying removes redundant parts.
2011-03-29 20:53:18 +03:00
Kimmo Varis b95e9c110c CLI: Remove quotation marks from user-given paths.
Ticket #2686 (regression/bug in path handling)

There are situations that paths given to command line can contain
quotation marks. In normal situations shell removes them. For
these cases they don't get removed add code to check paths from
quotation marks and remove them.
2011-03-28 22:26:14 +03:00
Greg Hewgill b26777c962 Merge branch 'cmdline-suppress' 2011-02-23 21:34:09 +13:00
Greg Hewgill ec4e0c8bf5 add documentation for --suppress= option 2011-02-23 20:59:30 +13:00
Greg Hewgill 22210e0255 add --suppress= command line option 2011-02-23 20:10:32 +13:00
Kimmo Varis d4786066a5 CLI: Fix CLI help text to fit in 80-char terminal. 2011-02-22 21:51:52 +02:00
Daniel Marjamäki 805773663e Build: Renamed HAVE_DEPENDENCIES to HAVE_RULES 2011-02-14 19:37:58 +01:00
Daniel Marjamäki 27febb062b cppcheck: Added HAVE_DEPENDENCIES define. Cppcheck cli can be compiled without dependencies. 2011-02-12 08:06:59 +01:00
Reijo Tomperi a71204b8e3 Change "tinyxml/tinyxml.h" includes into <tinyxml.h> and modify dmake to work with it.
This should allow usage of libtinyxml-dev or such libraries without modifications to code or makefile.
2011-02-10 22:35:48 +02:00
Reijo Tomperi 2bded1091b Improve --help listing by removing duplicate options list and using lt and gt characters for option arguments. 2011-02-05 22:59:26 +02:00
Daniel Marjamäki 2fa2157543 Cppcheck: Added short info about --rule and --rule-file to --help output 2011-02-05 20:15:22 +01:00
Stefan Weil 40b8c1d83f Add missing \n in CLI help. 2011-02-04 22:01:17 +02:00
Kimmo Varis 2d6d8580d7 Allow to exclude filenames (with paths).
This expands the CLI exclude feature to also allow excluding
filenames (with paths). When filename with recognized extension
is given to -i option then matching filenames (with paths) are
ignored when checking.

Ticket #2538 (Allow excluding files from the checking)
2011-02-03 14:43:42 +02:00
Raphael Geissert 61435684b2 Support multiple rules in a single XML file 2011-02-02 13:27:00 -06:00
Kimmo Varis ffc4bb481b Merge branch 'ignore-paths-cli' 2011-02-02 21:09:22 +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 1da88de932 Imrove --xml-version option parsing.
Allow --xml-version parsing to recognize also version 1 and print
errors about invalid values.
2011-02-02 14:04:50 +02:00
Kimmo Varis fe57d50328 Expose --xml-version=version cmd line option.
Make the --xml-version=version command line option public by
adding it to the command line help.
2011-02-02 13:28:14 +02:00
Kimmo Varis d334a02801 Make --exitcode-suppressions option consistent.
The --exitcode-suppressions option was inconsistent with other
long options by taking the filename as separate argument. Now
it expects format --exitcode-suppressions=filename.txt like
other long options.

Ticket: #1837 (--suppresions file.txt inconsistent)
2011-01-29 19:18:47 +02:00
Kimmo Varis 081e364298 Rename --suppressions-list CLI option.
The option --suppressions-list was inconsistent with other options
so renaming it to --suppressions-list.

Ticket: #1837 (--suppresions file.txt inconsistent)
2011-01-28 13:26:43 +02:00
Kimmo Varis 75695a723e Add --errorlist to CLI help.
Fixes ticket #2253 (Make CLI error listing documented and public switch)
2011-01-28 08:52:18 +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 f611c9aec7 cleanup old ifdefs in cmdlineparser 2011-01-24 18:15:56 +01:00
Daniel Marjamäki 10d2909c7c CLI: updated help text for --inline-suppr. Thanks rubicon_hdr for the suggestion 2011-01-20 20:29:06 +01:00
Kimmo Varis bd5e9e5309 Improve checking -D arguments for command line. 2011-01-17 21:19:27 +02:00
Kimmo Varis 6dd16d3919 Fix crash when giving -D without argument.
Fixes ticket #2476 (Crash when -D used without parameters.)
2011-01-17 21:03:22 +02: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 033e759c39 command line: added 'information' id to enable 2011-01-05 21:20:21 +01:00
Daniel Marjamäki 38e7209d26 Fixed #2373 (Using XML2 in --errorlist output) 2010-12-29 12:43:29 +01:00
Daniel Marjamäki 2d3865a671 Add support for user defined rules 2010-12-12 11:56:22 +01:00
Daniel Marjamäki 11a0ac4e07 xml2: rename '--xmlver' to '--xml-version'. bugfix in settings, change the type of _xml_version from bool to int. 2010-12-04 14:20:51 +01:00
Daniel Marjamäki 1f1df0645b Merge branch 'xml2' of github.com:danmar/cppcheck 2010-12-04 14:06:57 +01:00
Kimmo Varis c6c5fc6a1c Add tests for remaining CLI options. 2010-12-04 14:13:44 +02: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
Zachary Blair 215cb5ac8d Fixed #2162 (false positive: Mutual exclusion over ||) 2010-11-21 00:06:43 -08:00
Reijo Tomperi 1394d0245a Increase number of cores allowed by the cli to 10000 and add comment about the limit (it is there just to catch typos) 2010-11-20 22:33:46 +02:00
Daniel Marjamäki c1bf388b15 Fixed #2054 (Missing newline in 'invalid parameter' error message) 2010-09-18 16:11:46 +02:00
Kimmo Varis 940679e242 Fix ticket #2040 (some cli messages are missing a return at the end) 2010-09-10 18:39:36 +03:00
Daniel Marjamäki ad03c97a6e cmdlineparser: allow space between -D and define name. ticket: #2036 2010-09-08 17:42:28 +02:00
Reijo Tomperi d0423ff8ac Set encoding to UTF-8 for some files. 2010-09-06 22:39:02 +03:00
Kimmo Varis f36666572a Add couple of basic tests for CmdLineParser. 2010-09-06 22:31:06 +03:00
Daniel Marjamäki 5d539c76fe --help : added info about the '--enable=missingInclude' command 2010-09-06 19:15:21 +02:00
Stefan Naewe 078a0099dc cmdlineparser: handle '-h'/'--help' correctly 2010-09-06 19:12:40 +02:00
Kimmo Varis 688e26796f Fix compiling with GCC. 2010-09-05 11:47:31 +03:00
Kimmo Varis 45eaebe423 Move CLI command line parsing to own class. 2010-09-05 11:17:31 +03:00