Commit Graph

64 Commits

Author SHA1 Message Date
Matthias Krüger 42f0955e3f Move more setting checks out of loops and use const bools instead. Reorder a few related checks.
Follow up to eedcb6abcb .
2015-04-10 14:31:19 +02:00
PKEuS 7452613479 Refactorization:
- Merged messages exceptThrowInNoexecptFunction, exceptThrowInNoThrowFunction, exceptThrowInAttributeNoThrowFunction and exceptThrowInDeclspecNoThrowFunction into a single message.
- Merged Token::fIsDeclspecNothrow into Token::fIsAttributeNothrow
2015-01-09 20:18:09 +01:00
Robert Reif ba1c24ee65 Fixed #6422 (symbol database: put function flags into a single flag variable) 2015-01-08 05:45:31 +01:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
PKEuS c1b0bfe4ee Simplified code 2014-09-11 20:27:01 +02:00
PKEuS 0dc4b75565 Fixed crash on invalid code #6080 2014-08-23 12:36:42 +02:00
Daniel Marjamäki af2b94e322 Fixed #5826 (Change error message for 'throw in destructor' check) 2014-07-19 03:29:50 +02:00
Dmitry-Me 13234a7366 Shorten code by using temp variables, cleanup variable names. 2014-07-14 12:20:00 +04:00
PKEuS 8f79dc3ff8 Cleaned up includes and forward declarations in checkers:
- Removed definitely unnecessary forward declarations (e.g. "class Token"; token.h is already included by check.h, so a definition is unnecessary)
 - Removed unused includes
2014-05-24 12:50:03 +02:00
Robert Reif e993e2927c Fixed #5831 (FP in 1.65: call of pure virtual function 'throw' in destructor) 2014-05-20 06:10:34 +02:00
Robert Reif ae96491d6c Fixed #5756 (declspec(nothrow) not supported) 2014-05-04 20:47:20 +02:00
Robert Reif 7d762ca9f7 Made 'unhandled exception' inconclusive and style message. #5751 2014-05-02 06:57:23 +02:00
Robert Reif f6aaf6cc0d Unhandled exceptions: Dont warn when there are unhandled exceptions in main() function. #5751 2014-05-01 13:41:01 +02:00
Alexander Mai a25cb53c19 #5751 - Warning unhandledExceptionSpecification is issued even if warnings are not enabled 2014-04-30 19:33:17 +02:00
Alexander Mai 2c3807f089 #5703 - Segfault recursive loop - Patch by zingsheim 2014-04-21 22:13:02 +02:00
Daniel Marjamäki 0ced16d17a CheckExceptionSafety: Fixed crash when a function is missing function scope 2014-04-21 08:01:01 +02:00
Robert Reif 6ff5de2118 Fixed #5697 (Check for throw in __attribute__((nothrow)) function) 2014-04-20 20:40:55 +02:00
Robert Reif 36f4431481 Fixed #4800 (Check unhandled exceptions) 2014-04-20 08:58:36 +02:00
Alexander Mai 559a2bc2c8 Avoid FP exceptThrowInNoThrowFunction and exceptThrowInNoexecptFunction 2014-04-10 21:55:49 +02:00
Robert Reif 847d28d283 Fixed #5638 (is there any plan to check noexcept correctness?) 2014-04-10 16:17:10 +02:00
Lauri Nurmi 70a67eaf85 Change some more 0 literals into nullptr. 2014-02-16 13:38:50 +02:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
PKEuS d78c06dc3f Replaced _settings->isEnabled("style") by _settings->isEnabled("warning") wherever warnings are issued 2013-03-03 02:41:59 -08:00
Robert Reif 42588e9729 Fixed #4535 (Simplify checks by caching symbol database Variable pointer in Token) 2013-02-06 06:39:58 +01:00
Andrew C. Martin 4a73c93750 Fix compiler warnings and comment/string typos
- fix g++ warning:

> lib/checkother.cpp:3779: warning: comparison between signed and unsigned integer expressions

 - fix suncc warning (see [everything2](http://everything2.com/title/C%252B%252B%253A+static+extern+%2522C%2522)):

> "lib/checkmemoryleak.cpp", line 578: Warning (Anachronism): Formal argument __compar of type extern "C" int(*)(const void*,const void*) in call to bsearch(const void*, const void*, unsigned long, unsigned long, extern "C" int(*)(const void*,const void*)) is being passed int(*)(const void*,const void*).

- prefer empty() / isEmpty() over "size() > 0" (cases not caught by stlSize)

- fix word misspellings (mostly comments, a few output lines)

  - Parenthesis => Parentheses (both variations were used in the codebase)

  - fix typo and wording ("never alwayw") in gui/test/data/benchmark/simple.cpp's CheckOther::unsignedPositive():

```
-  "An unsigned variable will never alwayw be positive so it is either pointless or "
+  "An unsigned variable can't be negative so it is either pointless or "
```
2013-01-16 07:37:07 -07:00
Reijo Tomperi 5d5f7085bf Updating year 2012 -> 2013 to .cpp and .h files and man page. 2013-01-01 18:29:08 +02:00
Robert Reif 3064b48156 speed up checks by caching commonly looked up stuff in the symbol database (checkexceptionsafety) 2012-10-14 17:40:17 +02:00
PKEuS c8773b891d Refactorization: Make use of Token::scope() replacing certain indentation counters 2012-08-12 03:13:07 -07:00
Daniel Marjamäki a37c3144ed Fixed #3858 (Throw exception in destructor BUT inside a try-catch shouldn't be reported) 2012-06-17 14:33:18 +02:00
PKEuS dc64ac2918 Removed unnecessary variable Function::start - The value is already stored in Function::functionScope->classStart. 2012-05-22 12:58:46 -07:00
PKEuS d5c2c7db88 - Moved checkCatchExceptionByValue from CheckOther to CheckExceptionSafety
- Fixed false positive: throw outerCatchVar; in inner catch is now correctly handled
- Added eTry and eCatch to Scope::isLocal -> Scopes inside catch are now detected by symbol database
2012-02-02 16:17:42 +01:00
PKEuS 5c2af0b2e3 - initialising std::string with 0 in initialisation list is partially detected in nullpointer check (#3520)
- executionpath checking makes use of symboldatabase
- CheckExceptionSafety::checkRethrowCopy makes use of symboldatabase
2012-01-26 16:50:59 +01:00
PKEuS 87e19d2552 Refactorized check for dead pointers after throw:
- Less bailouts for inconclusive checking
- Support for static variables
- Changed severity to warning (error is not certain)
2012-01-21 19:11:06 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
OGAWA KenIchi 3e9d8e6ae1 Fixed #3422 (Internal error in exceptRethrowCopy check) 2011-12-17 20:00:15 +01:00
PKEuS a311904a0f Patch that fixes some bailouts for isEnabled('style') in both directions. Improved checkSizeofForNumericParameter's error message, made it 'warning', made it non-experimental. 2011-12-16 19:21:14 +01:00
PKEuS f46cf5fd65 Exception safety: refactorings, use the symbol database 2011-12-09 19:53:00 +01:00
Edoardo Prezioso 2c64d299ca Change every 'tokAt(...)->str()' to 'strAt(...)'. 2011-11-13 13:10:59 +01:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Kimmo Varis cfcfa3f000 Use "enabled" list for the style checking.
Settings-class currently enables style checking via dedicated
boolean attribute. All other CLI's enable-options are handled
through the enable-list. This commit moves style-check enabling
to use the enable-list.

Main advantage is the consistency how options are handled/stored
in the Settings class. Which also unifies using them for the other
code. You need to enable certain type of checks? Use the
addEnabled()-method. You want to check if certain type of checks
are enabled? Use the isEnabled()-method.
2011-08-07 10:28:52 +03:00
Zachary Blair 44a350a6dc Ticket #2388. Added more detail to the 'exceptRethrowCopy' error message. 2011-02-06 02:01:14 -08:00
Zachary Blair 8a494cf8bb Fixed #2388 (Use throw without argument to rethrow exceptions) 2011-02-05 01:11:09 -08:00
Reijo Tomperi 226b605774 Change year 2010 -> 2011 in license texts. 2011-01-09 21:33:36 +02:00
Daniel Marjamäki 14cbaebfe2 Fixed #2428 (false alarm with code containing a throw clause) 2011-01-07 20:45:33 +01:00
Daniel Marjamäki 1fa730d963 added some comments 2010-12-31 13:58:17 +01:00
Daniel Marjamäki 3a8e7b4bf0 Exception safety: Removed the noisy checks and keep the useful checks 2010-08-31 22:22:59 +02:00
Daniel Marjamäki a274cb1015 cleanup headers 2010-07-31 08:52:28 +02:00
Daniel Marjamki d7b117402c Code cleanup: Removed autodealloc handling 2010-05-16 07:15:31 +02:00
Daniel Marjamäki 6b52730d4e Fixed #1616 (false positive - Upon exception there is a memory leak) 2010-04-24 14:51:10 +02:00
Reijo Tomperi 35d2a27b9c Update copyright year in all source files 2010-04-13 22:23:17 +03:00