Commit Graph

106 Commits

Author SHA1 Message Date
Daniel Marjamäki bd7790fd8c Update copyright year 2019-02-09 07:24:06 +01:00
amai2012 03ed4afc70 Export interfaces from cppcheck-core.dll used from testrunner. In turn remove ctu sources from testrunner which are obsolete now. 2018-12-28 23:09:44 +01:00
Daniel Marjamäki 271763e680 CTU: Refactoring 2018-12-25 21:11:23 +01:00
Daniel Marjamäki 23eb98d2ca Renamed Check::_name 2018-06-16 16:31:07 +02:00
Daniel Marjamäki 79ffe1d4fc Rename _tokenizer, _settings, _errorLogger 2018-06-16 16:10:28 +02:00
Daniel Marjamäki c2c43ce8a7 Code cleanup, use '= delete' 2018-05-28 12:44:18 +02:00
Daniel Marjamäki f058d9ad08 CLI: Added more fields for --template and added a new --template-location. The gcc predefined template now matches latest gcc better. 2018-04-23 12:21:18 +02:00
PKEuS d2146844dd Refactorizations:
- Replace several push_back-calls by emplace_back
- Replace some x = x.substr(0, y) calls by x.erase(y)
2018-04-11 09:44:35 +02:00
Daniel Marjamäki c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
Ivan Maidanski 97ffec85c0 Fixed #7502 (Correct exit code if never used function is found) (#1026) 2018-01-12 08:24:01 +01:00
Daniel Marjamäki fdbd6e688f Remove unused function 2018-01-08 18:55:00 +01:00
Ayaz Salikhov 1d2b58e828 Correctify explicit usage (#951) 2017-09-07 13:03:45 +02:00
Ayaz Salikhov b8cd7dbb5c Use nullptr instead of 0 or NULL (#936) 2017-08-09 20:00:26 +02:00
Daniel Marjamäki 150d2aa902 Refactor and rename CHECK_WRONG_DATA 2017-06-05 18:41:15 +02:00
Daniel Marjamäki 62c22a8e06 daca2: change output for DacaWrongData. Show location. And use severity 'debug' 2017-06-04 19:46:20 +02:00
Daniel Marjamäki 66a488586e Temporarily readd the UNSTABLE configuration 2017-06-04 18:30:49 +02:00
Daniel Marjamäki 0c6a551039 Try to limit Daca2WrongData output a little 2017-06-04 16:41:30 +02:00
Daniel Marjamäki 9715164d0a Fixed DACA2 CHECK_WRONG_DATA macro 2017-06-04 15:50:27 +02:00
Daniel Marjamäki 35348fcf98 Try to fix Travis 2017-06-04 14:46:57 +02:00
Daniel Marjamäki 2106099029 daca2: print error message (DacaWrongData) instead of crashing when wrong data is seen 2017-06-04 14:05:34 +02:00
Daniel Marjamäki aeef7117fe astyle formatting
[ci skip]
2017-06-03 11:34:30 +02:00
Daniel Marjamäki 7ec3715c57 check.h: Cppcheck will be stable by default. Use -DUNSTABLE to make it unstable. 2017-06-03 11:18:00 +02:00
Alexander Mai b4a58be113 #define HIDE_WRONG_DATA to get release mode build (hiding crashes on invalid AST/symboldatabase). Fix doxygen syntax. 2017-06-01 23:38:02 +02:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki 0262020707 --template: Removed 'clang' and renamed 'cppcheck2' to 'daca2' 2017-05-25 05:24:42 +02:00
Daniel Marjamäki a3c0eecccf Added --template=cppcheck2 output format 2017-05-23 12:19:11 +02:00
Daniel Marjamäki 7af58cf31a show full error path in xml files 2017-05-22 07:42:54 +02:00
Daniel Marjamäki 55ae206ecc ErrorPath: better output 2017-05-19 17:29:16 +02:00
Daniel Marjamäki b53a2ff9eb Command line: Added --template=clang formatting 2017-05-19 17:09:49 +02:00
Daniel Marjamäki c617851567 ErrorLogger: Added ErrorPath where each item has token and info 2017-05-16 22:38:13 +02:00
Daniel Marjamäki 8d75d1b920 Partial fix for #8028 (ValueFlow: Origin/callstack of value) 2017-05-15 20:05:11 +02:00
Daniel Marjamäki 45d998979c CHECK_WRONG_DATA: switch to debug macro 2017-05-13 19:10:05 +02:00
Daniel Marjamäki 5fd77d2518 Switch CHECK_WRONG_DATA macro so crashes/hangs are avoided 2017-04-28 10:48:41 +02:00
Daniel Marjamäki 6f2db1a312 CHECK_WRONG_DATA: restore debug macro so crashes are seen. 2017-04-02 17:23:30 +02:00
Daniel Marjamäki cc3ef7bbe8 Fix so array access out of bounds for external arrays are detected again 2017-03-30 10:14:17 +02:00
Daniel Marjamäki 6874f27e73 Added CHECK_WRONG_DATA() that can be used to avoid crashes/hangs in release binaries 2017-03-26 11:23:39 +02:00
Daniel Marjamäki 9ff3e85899 Added --cppcheck-build-dir flag 2016-10-29 12:18:11 +02:00
Alexander Mai 0533d7bf9c Run astyle + minor refactoring 2016-02-27 16:03:50 +01:00
Roberto Martelloni d3645d874e Mapped toomanyconfigs ,AssignmentAddressToInteger
,AssignmentIntegerToAddress ,CastIntegerToAddressAtReturn
,CastAddressToIntegerAtReturn ,assertWithSideEffect ,assignmentInAssert
,uselessAssignmentArg ,uselessAssignmentPtrArg
,comparisonOfFuncReturningBoolError
,comparisonOfTwoFuncsReturningBoolError ,comparisonOfBoolWithBoolError
,incrementboolean ,comparisonOfBoolWithInt ,compareBoolExpressionWithInt
,negativeIndex ,pointerOutOfBounds ,arrayIndexThenCheck
,possibleBufferAccessOutOfBounds ,argumentSize
,arrayIndexOutOfBoundsCond ,noConstructor ,copyCtorPointerCopying
,noCopyConstructor ,uninitMemberVar ,operatorEqVarError
,unusedPrivateFunction ,memsetClassFloat ,mallocOnClassWarning
,operatorEq ,thisSubtraction ,operatorEqRetRefThis ,operatorEqToSelf
,useInitializationList ,duplInheritedMember ,assignIfError
,comparisonError ,multiCondition ,mismatchingBitAnd
,oppositeInnerCondition ,incorrectLogicOperator ,redundantCondition
,moduloAlwaysTrueFalse to their CWEs ids.
2016-02-26 23:53:52 +00:00
Daniel Marjamäki 5e10e680da CWE: refactoring. use constants instead of magic numbers. 2016-01-25 20:01:48 +01:00
Lauri Nurmi 996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
Daniel Marjamäki 0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
Alexander Mai 2c73518e29 Fix platform-dependent test result, formatting and crash in whole program analysis 2015-06-28 17:54:48 +02:00
Daniel Marjamäki 88f59ad7e8 Partial fix for #6656 (Allow that CWE is mapped for error message) 2015-04-25 17:48:11 +02:00
Jakub Melka e1e1dbfe97 Ticket #695: Fixed VS 2010 issue, switched to "style" severity, changed error messages and updated unit tests 2015-03-10 19:35:12 +01:00
Jakub Melka b7d92a4fc7 Fixed warnings of CppCheck's own code (caused by new check #695) 2015-03-08 18:18:09 +01:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01: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 139414bd5c astyle formatting 2014-11-26 16:13:57 +01:00
Jay Sigbrandt f7eeb82ca4 Fix SEGV on Solaris x86
On Solaris x86, with both GCC 4.8 and 4.9, running cppcheck causes a segmentation fault when process terminates.

The backtrace (dbx) where
=>[1] _ZNSt14_List_iteratorIP5CheckEppEv(0x804798c, 0x8047994, 0xc0d61d6, 0x291a), at 0x8291b7c
  [2] std::list<Check*, std::allocator, <Check*>void>::remove(0x84ab328, 0x80479c8, 0x80479d4, 0x82d96fc), at 0x82da984
  [3] Check::~Check(0x84a9fc4, 0x83d232c, 0xfef411fb, 0x83d135c), at 0x82d9709
  [4] CheckExceptionSafety::~CheckExceptionSafety(0x84a9fc4, 0xfee82a40, 0xfee82a40, 0xfedcf000), at 0x8311e7d
  [5] __static_initialization_and_destruction_0(0x0, 0xffff, 0xfedd4c80, 0xfedcf000), at 0x81b01f8
  [6] _GLOBAL__sub_D__ZN20CheckExceptionSafety11destructorsEv(0x83d135c, 0xfedd4f18, 0x8047a50, 0x828a5f5, 0xfedcf000, 0x8047a68), at 0x81b023c
  [7] __do_global_dtors_aux(0xfedcf000, 0x8047a68, 0xfece28cd, 0x8047b08, 0x8047a48, 0xfedcf000), at 0x8185b90
  [8] _fini(0x8047b08, 0x8047a48, 0xfedcf000, 0xfedd4f00, 0x8047a80, 0xfecd4e72), at 0x828a5f5
  [9] _exithandle(0xfeffb7d8, 0x8185a1a, 0x0, 0x0, 0x0, 0x0), at 0xfece28cd
  [10] exit(0x1, 0x8047b70, 0x0, 0x8047ba3, 0x8047bba, 0x8047ce6), at 0xfecd4e72

The destructor order is somehow getting messed up on this platform.

This fix moves the code away from header file and ensures _instances remains valid during termination.
2014-11-25 14:03:46 +01:00