Thomas Jarosch
ec21134817
Fix false negatives for local suppressions
...
Introduce a new bool setting jointSuppressionReport
that will be set by the analyseWholeProgram() code path.
When the flag is enabled, unmatched suppressions are
collected after running the final whole program analysis
to prevent false positives for the unusedFunction check.
The check functions in the unit test
for single / multi file suppressions were unified.
2015-01-20 18:47:30 +01:00
PKEuS
787cbcb02e
Accept unknown elements in Library files, but print a warning. This fixes backward compatibility of libraries with older cppcheck versions
2015-01-10 22:18:57 +01:00
Daniel Marjamäki
ff11ba9847
Updated copyright year to 2015
2015-01-03 12:14:58 +01:00
Thomas Jarosch
9438b49bfb
Fix build on PowerPC
...
PowerPC does not provide ucontext.gregs or the REG_ERR define.
Found while testing big endian platform.
2014-12-31 01:44:50 +01:00
Ni2c2k
666fa04ed8
don't use USE_UNIX_BACKTRACE_SUPPORT on Qnx
2014-12-16 20:11:25 +05:00
Daniel Marjamäki
0b9d80c95d
Refactoring CheckUnusedFunctions so it uses new infrastructure for multifile analysis
2014-12-02 06:41:18 +01:00
Daniel Marjamäki
a002654c47
Reverted refactoring 828417c
for now. It caused a major slowdown in the unused functions checking.
2014-11-24 06:37:08 +01:00
Simon Martin
3ca2a177b5
Restore build on Mac OSX >= 10.7 since the inclusion of ucontext.h
2014-11-15 20:17:25 +01:00
Daniel Marjamäki
828417c934
CheckUnusedFunction: Refactorings to use same infrastructure for whole program analysis as CheckUninitVar and CheckBufferOverrun
2014-11-15 18:44:23 +01:00
Daniel Marjamäki
de7e9223b8
Fixed #6272 (Improve check: multifile checking in checkbufferoverrun)
2014-11-15 10:43:49 +01:00
Alexander Mai
5786be99c5
Improve exception handler: detect read or write on SIGSEGV (linux only), create more suitable core dump, reduce usage of fprintf()
2014-11-14 23:40:53 +01:00
Alexander Mai
95cd0f396a
#6026 backtrace() not portable - linker error on NetBSD
2014-11-02 15:47:55 +01:00
Robert Reif
e2f72b4cb1
Fixed #6215 (Move Windows platform types into library)
2014-10-19 07:34:40 +02:00
Dmitry-Me
7342a81ea7
Minor refactorings. rename token. cleanup if/else.
2014-09-02 16:10:51 +02:00
PKEuS
e35329aba3
Fixed reporting of unmatched suppressions for unusedFunction ( #4946 )
2014-09-01 10:13:03 +02:00
XhmikosR
7294ae2a88
Fix a C6328 warning.
...
Potential argument type mismatch.
2014-08-31 10:05:34 +03:00
Daniel Marjamäki
6afe9a4fbe
astyle formatting
...
[ci skip]
2014-07-08 06:44:57 +02:00
amai2012
9b38ae73c1
Attempt to fix 2 Coverity messages.
...
Replace a few unsigned int by std::size_t
2014-07-07 21:25:30 +02:00
amai2012
6b5f34df4b
ix compiler warning on Windows 64bit
2014-06-30 12:48:42 +02:00
Daniel Marjamäki
cdf081dbd5
astyle formatting
...
[ci skip]
2014-06-29 22:53:52 +02:00
amai2012
df988dfff3
Fix cppcheck warning in previous changeset
...
Signed-off-by: amai2012 <amai@users.sf.net>
2014-06-29 19:12:59 +02:00
amai2012
e60ee4ad3b
Print callstack in SEH on Windows
2014-06-29 18:57:48 +02:00
Alexander Mai
4d6c17818d
Try to fix configuration of un*x signal handling and backtrace support
2014-06-28 14:05:18 +02:00
amai2012
e124983e11
Improve error message for Windows SEH adding more details if available
2014-06-28 12:14:00 +02:00
Jay Sigbrandt
51fdf3f14f
Simplify defines.
2014-06-27 08:03:05 +02:00
Jay Sigbrandt
e7210521ac
Many platforms don't support backtraces. Fix compile for Solaris platform.
...
This change was tested with Solaris 10 on X86 and SPARC.
More information on Unix Backtrace Support
- http://www.gnu.org/software/libc/manual/html_node/Backtraces.html
It is not supported on the following platforms:
- https://www.gnu.org/software/gnulib/manual/html_node/execinfo_002eh.html
Mac OS X 10.3,
FreeBSD 6.0,
NetBSD 5.0,
OpenBSD 3.8,
Minix 3.1.8,
AIX 5.1,
HP-UX 11,
IRIX 6.5,
OSF/1 5.1,
Solaris 10,
Cygwin,
mingw,
MSVC 9,
Interix 3.5,
BeOS.
2014-06-26 11:41:16 +02:00
Daniel Marjamäki
d4bc643ed4
CLI: don't use unix-signals if NO_UNIX_SIGNAL_HANDLING is defined. don't use unix-signals in os/2.
2014-06-15 11:17:44 +02:00
Daniel Marjamäki
d9a3761bfd
Merge pull request #331 from Dmitry-Me/DontExitInTheMiddle
...
Should not call std::exit() in the middle of program
2014-06-06 13:35:29 +02:00
PKEuS
f7f639465a
Fixed remaining VS warnings (hopefully all of them, this time)
2014-06-05 10:45:25 +02:00
Dmitry-Me
738d05b442
Calling std::exit() in the middle of a C++ program subverts stack unwinding and can introduce subtle bugs.
2014-06-05 11:28:04 +04:00
Alexander Mai
707ee97b9e
Fix missing break while handling SIGBUS - fixes clang compiler warning
2014-05-29 16:57:45 +02:00
Daniel Marjamäki
ed78d3e148
Library: Better error reporting when loading fails
2014-05-26 17:00:41 +02:00
Alexander Mai
7b36bbbba8
Exception handling: catch SIGBUS. Evaluate siginfo_t::si_code
2014-05-25 15:53:26 +02:00
Alexander Mai
5198c05f35
--exception-handling now takes optional argument to choose between stdout and stderr for its output. stdout is new default value
2014-05-25 08:47:37 +02:00
Alexander Mai
ed78835020
Cosmetics for print_stacktrace()
2014-05-17 10:40:48 +02:00
Alexander Mai
08c209d4d9
Some cleanup for CppcheckSignalHandler, also some cosmetics for the output
2014-05-11 13:25:36 +02:00
Daniel Marjamäki
1903d95015
Fixed #5661 (--suppress=missingInclude has no effect)
2014-05-03 19:31:15 +02:00
Alexander Mai
718e42f5ca
Fix some clang warnings about type conversions
2014-04-11 23:35:53 +02:00
Alexander Mai
a06371e063
Fixes for Doxygen + code formatting
2014-04-07 20:39:19 +02:00
Daniel Marjamäki
22c4d45ca0
astyle formatting
2014-03-31 03:06:57 +02:00
Alexander Mai
a12e59dbee
Make backtrace resemble gdb bt
2014-03-30 21:29:17 +02:00
Daniel Marjamäki
fbd607d35d
Fixed cygwin compilation
2014-03-22 09:57:43 +01:00
Martin Ettl
fe1b46c174
Extended std.cfg
2014-03-19 21:08:48 +01:00
Alexander Mai
af922aedbf
Fix mingw build
2014-03-18 21:14:09 +01:00
Alexander Mai
14386d06dc
Enable SEH for Windows using MSVC (not for mingw)
2014-03-17 19:11:00 +01:00
Martin Ettl
80b1271d01
Astyle running and added test cases for functions in std.cfg.
2014-03-10 02:21:44 +01:00
Alexander Mai
c2a602a6bd
Refactor signal handling code: prepare for demangling names, handle SIGINT w/o backtrace, remove our own signal handler frames from backtrace
2014-03-16 18:37:28 +01:00
Alexander Mai
825bb0f027
Fixed #5286 (Add signal/exception handling to cppcheck and cppcheck-gui)
2014-03-16 12:04:13 +01:00
Daniel Marjamäki
fd3a8a2a18
Update copyright
2014-02-15 07:45:39 +01:00
Kamil Dudka
1f53018b8e
Suppress warning about non-existing path given to -I with --quiet.
2014-01-10 21:50:21 +01:00
Daniel Marjamäki
6ff93a6b36
CLI: Made the 'failed to load std.cfg' nicer and more informative.
2014-01-03 21:59:50 +01:00
Daniel Marjamäki
a94fccf51a
astyle formatting
2014-01-02 21:47:35 +01:00
Sam Truscott
4333dd3c75
Update Qt to support Markup structure
2014-01-02 18:18:24 +01:00
Daniel Marjamäki
562387e3ff
library: use extensions when loading std.cfg and posix.cfg
2013-12-26 13:18:54 +01:00
Daniel Marjamäki
4131c621c9
Fixed #5254 (Warn about missing library files (.cfg))
2013-12-26 11:15:28 +01:00
Daniel Marjamäki
76b907fe65
Fixed #5252 (Improve check: use Library to validate function arguments in invalidFunctionUsage)
2013-12-23 10:06:45 +01:00
Daniel Marjamäki
e446a28b3d
Refactoring FileLister and Path so they don't depend on Library
2013-10-31 19:09:01 +01:00
Sam Truscott
6806fd8135
Extended Qt support through Library
2013-10-20 14:09:10 +02:00
Daniel Marjamäki
43b40b7465
Refactoring: Reordered includes. Put local ones before system includes.
2013-09-04 06:18:22 +02:00
Daniel Marjamäki
0c5e39a813
Library: Added configuration file std.cfg that clients should load.
2013-07-20 17:12:56 +02:00
Daniel Marjamäki
a7da65a40b
Fixed #4618 (Unmatched suppression: don't show this information message unless --enable=information or --check-cfg is used)
2013-05-31 15:20:58 +02: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
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