Commit Graph

9479 Commits

Author SHA1 Message Date
Daniel Marjamäki b830f462e6 Added missingOverride checker; Function 'f' overrides function in base class but does not have the 'override' keyword. 2018-04-27 11:12:09 +02:00
Daniel Marjamäki c7e5b941be Symbol database: Minor tweaks 2018-04-27 10:35:11 +02:00
Daniel Marjamäki 8304290f06 astyle formatting
[ci skip]
2018-04-27 10:29:27 +02:00
Daniel Marjamäki d15b945c9e SymbolDatabase::isFunction: Fix wrong detection function 2018-04-27 10:24:02 +02:00
Simon Martin 9fade65dbb Ticket #8281, #8417: Properly detect the end of "switch" statements to accept all legitimate uses of "case". (#1112) 2018-04-26 22:26:26 +02:00
Daniel Marjamäki 5384802e16 SymbolDatabase: Look for types in anonymous scopes 2018-04-26 17:55:04 +02:00
amai2012 55983e2a0b #8509 Uniform initialization ignored for iterator 2018-04-26 08:57:25 +02:00
Daniel Marjamäki d8634ca2a9 SymbolDatabase: Disable code for function pointers
This hopefully fixes all Travis crashes when running cppcheck:
[./test/Analysis/stack-addr-ps.c] (error) Internal error: Child process crashed with signal 11 [cppcheckError]
[./test/Index/complete-pointer-and-reference-to-functions.cpp] (error) Internal error: Child process crashed with signal 11 [cppcheckError]
[./test/SemaCXX/vararg-non-pod.cpp] (error) Internal error: Child process crashed with signal 11 [cppcheckError]
2018-04-25 18:48:26 +02:00
rebnridgway faf348306b Escaped filename, which can contain invalid xml (#1192) 2018-04-25 18:28:04 +02:00
Daniel Marjamäki e95c6e3038 Travis: Fix segmentation fault 2018-04-25 16:02:42 +02:00
Daniel Marjamäki bd54986017 SymbolDatabase: Refactoring parsing of ) ... in functions 2018-04-25 14:35:09 +02:00
Daniel Marjamäki 6efe118aa3 Fix Cppcheck warning 2018-04-25 14:29:34 +02:00
Daniel Marjamäki e97be9db2f SymbolDatabase: Refactoring, move logic from SymbolDatabase to Function class. Add a Function::isOverride() method. 2018-04-25 12:05:49 +02:00
Daniel Marjamäki 9aeb2aaa17 update doxygen comments 2018-04-25 10:14:57 +02:00
IOBYTE fac851192a SymbolDatabase: fix problem where definition coudn't find forward declaration in class (#1190) 2018-04-24 22:43:47 +02:00
Daniel Marjamäki deaafd59d7 CheckClass: Undo the rule of 3 checker to avoid some warnings 2018-04-24 22:42:25 +02:00
rebnridgway 995b496ddf Add suppressions to the XML dump (#1166)
* Added parsing suppressions from dump xml.

* Added code to dump suppressions to an xml file

* Added declaration for dump function

* Suppressions will now be written to the xml file when a dump is requested

* Fixed syntax error

* Removed excess whitespace

* Fixed indentation to be consistent

* Fixed indentation to be consistent

* Fixed indentation to be consistent

* Added missing include for ErrorLogger::toXml

* Fixed suggestions from pull request #1166

Switched to using ranged for loop to iterate through suppressions.
Made the line number attribute optional, rather than 0 if not specified.  This means when Python deserialises it it will be None, which is more pythonic.

* Implemented checking suppressions in reportError

This modification expects suppressions and a function to be called to write a line of output to be passed in.  The function checks if any of the suppressions match the warning (with the new Suppression.isMatch function) and if so returns None.  This change maintains the old behaviour of returning the warning text, but adds the possibility of returning None if the warning was suppressed.

* Fixed code quality warnings

* Removed more extraneous whitespace
2018-04-24 22:19:24 +02:00
Daniel Marjamäki 485d3e0229 CheckClass: Tweak rule of 3 checker 2018-04-24 21:45:30 +02:00
Daniel Marjamäki 5518247b96 Refactoring; use range for 2018-04-24 21:18:36 +02:00
Daniel Marjamäki b0b08a3bb0 Refactoring: Use range for loop 2018-04-24 18:17:47 +02:00
Daniel Marjamäki dbcdb19b73 Refactoring; Use range for 2018-04-24 18:02:36 +02:00
Daniel Marjamäki 6fb25dcaa4 CheckClass: Changed checker for 'copy constructor' and 'operator=' to a 'rule of 3' checker 2018-04-24 16:07:58 +02:00
Daniel Marjamäki 8310198cd5 SymbolDatabase: Refactoring and testing isImplicitlyVirtual 2018-04-24 13:53:58 +02:00
Daniel Marjamäki b94d8fd686 SymbolDatabase: Improve doxygen comments 2018-04-24 13:03:32 +02:00
Daniel Marjamäki c3cb0ddf8c Refactoring; use range for loops 2018-04-24 11:13:19 +02:00
Daniel Marjamäki f7db818273 errorlogger: fix handling of {inconclusive} 2018-04-24 11:10:41 +02:00
Daniel Marjamäki 22963f3ed8 Refactoring; use range for loop 2018-04-24 11:04:47 +02:00
Daniel Marjamäki bb227613bb SymbolDatabase: Better type lookup in methods 2018-04-23 22:27:15 +02:00
Daniel Marjamäki f021094f75 minor refactorings in SymbolDatabase 2018-04-23 21:45:25 +02:00
Daniel Marjamäki e3a4ef795e Refactoring: After conditional return the 'else' is not needed 2018-04-23 16:27:56 +02:00
Daniel Marjamäki 6d86ad78ba Refactoring, use early continue 2018-04-23 16:23:22 +02:00
Daniel Marjamäki 84aaec26e6 --template: fixed {code} output with tabs 2018-04-23 14:11:33 +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
Daniel Marjamäki b44a40801b ErrorLogger: add {column} and {code} 2018-04-23 09:18:32 +02:00
Daniel Marjamäki 42c54f12fe Refactoring: Use range for loops in CheckClass 2018-04-23 07:51:28 +02:00
Daniel Marjamäki e08683c009 Refactoring: Use range for loops in CheckFunctions 2018-04-23 07:49:38 +02:00
Daniel Marjamäki c6d834ae17 Refactoring: Use range for loops in CheckBool 2018-04-23 07:46:37 +02:00
Daniel Marjamäki b6e89f85d0 CheckOther: Use isLikelyStreamRead 2018-04-22 17:14:28 +02:00
Daniel Marjamäki b7a52c3811 CheckUnusedVar: Use isLikelyStreamRead 2018-04-22 17:08:23 +02:00
Daniel Marjamäki fba8208134 CheckUninitVar: Use isLikelyStreamRead 2018-04-22 17:04:54 +02:00
Daniel Marjamäki cc4977e140 Tweaking CheckUninitVar (<< and >> handling) 2018-04-22 16:39:57 +02:00
Daniel Marjamäki 7b10375683 Try to make Travis happy 2018-04-22 14:00:03 +02:00
Daniel Marjamäki 3d78320d04 CheckCondition: Use isLikelyStreamRead 2018-04-22 09:48:54 +02:00
Daniel Marjamäki 0263452f5d CheckClass: Use isLikelyStreamRead 2018-04-22 07:45:36 +02:00
Daniel Marjamäki be48de1be9 CheckClass: Use isLikelyStreamRead 2018-04-22 07:40:11 +02:00
Daniel Marjamäki 121d4ff2ba isLikelyStreamRead: when using & dont allow astParent 2018-04-22 07:30:45 +02:00
Daniel Marjamäki e1db4c0e2c astyle formatting
[ci skip]
2018-04-21 13:28:31 +02:00
Daniel Marjamäki 8cc7131ee9 Rename CppCheck::processFile to CppCheck::checkFile 2018-04-21 13:28:26 +02:00
Simon Martin a451a5b598 Ticket #8436: Handle C++11 initializations within ternary operator. (#1174) 2018-04-21 11:30:07 +02:00
Paul Fultz II d939c6015a Report opposite expressions (#1182)
* Report opposite expressions

* Skip assignment operator
2018-04-21 11:28:21 +02:00