Commit Graph

40 Commits

Author SHA1 Message Date
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
Daniel Marjamäki 0cad22314e Reverted 'astyle fix'. Those changes are not in sync with my astyle configuration/setup. 2010-04-02 07:30:58 +02:00
Martin Ettl 193aa7d1d3 astyle fix 2010-04-02 02:21:53 +02:00
Daniel Marjamäki 83d5a72659 Fixed #1126 (False positive: upon exception there is memory leak (calling unknown function)) 2009-12-21 20:04:55 +01:00
Daniel Marjamäki 1002457b17 Fixed #1074 (Exception safety: auto deallocated classes don't leak) 2009-12-12 18:56:26 +01:00
Daniel Marjamäki e5c507dc02 Fixed #1063 (False positive: deallocated memory doesn't leak upon exception) 2009-12-07 19:23:33 +01:00
Daniel Marjamäki da4d03f6c4 Fixed #1048 (False positive: exceptNew error with nothrow) 2009-12-05 22:05:59 +01:00
Daniel Marjamäki 642469b93f Fixed #1044 (Access violation with --enable=all) 2009-12-05 17:37:30 +01:00
Reijo Tomperi f5c81429cb Refactoring: Parse --enable values in Settings class 2009-11-30 23:48:58 +02:00
Daniel Marjamäki 2b1b7f78f5 Fixed #883 (Add new command line argument --enable) 2009-11-15 15:24:33 +01:00
Daniel Marjamäki 41e59d8348 Fixed #832 (Exception Safety: deallocating member pointer and then throwing exception) 2009-11-08 09:54:08 +01:00
Daniel Marjamäki 68f63fdd75 Exception safety: added check for unsafe reallocation of member pointer 2009-11-03 20:26:52 +01:00
Daniel Marjamäki 616a760b6c Exception Safety: detect unsafe multiple new in a execution path (#831) 2009-11-03 19:43:51 +01:00
Daniel Marjamäki 543d5cbf45 Fixed #831 (Exception safety: multiple new in a simple execution path) 2009-10-31 18:58:42 +01:00
Daniel Marjamäki 09859c1019 refactoring the folder structure 2009-10-25 12:49:06 +01:00