Commit Graph

87 Commits

Author SHA1 Message Date
Daniel Marjamäki c4caee6b18 Updated copyright year 2018-01-14 15:37:52 +01:00
Ayaz Salikhov 28aa939d69 iwyu - include what you use 2017-05-27 04:33:47 +02:00
Daniel Marjamäki 040d2f0012 Use simplecpp lexer in test cases 2017-05-18 21:52:31 +02:00
Daniel Marjamäki b7b92b2140 Fixed #6674 (false positive 'unusedPrivateFunction' - calling virtual function in subclass) 2016-05-21 20:07:35 +02:00
Daniel Marjamäki 99fc13ee70 Fixed #6968 (unusedPrivateFunction not correct, called by inner class) 2016-05-16 20:52:50 +02:00
Daniel Marjamäki 65998f1d7c CheckClass: previous change introduced false positives when Token::function() is wrong. Avoid those false positives. 2016-05-16 10:55:22 +02:00
Daniel Marjamäki bce15b1ade CheckClass: refactored the code, use symboldatabase instead of name comparisons when possible, fixed a FN. 2016-05-16 09:36:26 +02:00
Daniel Marjamäki 95009a4630 Merge pull request #745 from lanurmi/2016_ad
Update copyright year to 2007-2016.
2016-01-01 22:57:19 +01:00
Daniel Marjamäki f5715c1496 Rename Unspecified platform type to Native 2016-01-01 16:39:41 +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
PKEuS 3a5cef8a7e Refactorization: Improved usage of Settings instances in test suite 2015-10-07 18:40:03 +02:00
amai2012 480a5672b0 #6298 stack overflow in Scope::findFunctionInBase (endless recursion). Fix handling of circular class hierarchy 2015-07-01 00:04:01 +02:00
orbitcowboy 06e818f89d Running astyle, no functional change. 2015-06-17 09:09:23 +02:00
amai2012 33d7631ee3 Fix another Borlad-specific test by setting Windows platform type
Refactoring: make CheckIO::ArgumentInfo aware of language (C vs. C++) to perform some optimizations
2015-06-16 23:11:34 +02:00
PKEuS bc5132e0ac Refactorization: Moved declaration of errout, ... to testsuite.h, uniformized style 2015-03-11 22:54:43 +01:00
Robert Reif 130ffc5752 Fixed #6538 (Symboldatabase: improve isFunction) 2015-02-24 06:11:31 +01:00
Daniel Marjamäki 830d1eb3fd Revert "Fixed #6538 (Symboldatabase: improve isFunction)"
This reverts commit d7ef89bbe6.

There was crashes in a Travis job.
2015-02-23 08:07:19 +01:00
Robert Reif d7ef89bbe6 Fixed #6538 (Symboldatabase: improve isFunction) 2015-02-23 06:49:50 +01:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
Daniel Marjamäki 051d42ae6b astyle formatting 2014-11-20 14:20:09 +01:00
orbitcowboy f5d804f71a running astyle 2014-11-20 10:13:03 +01:00
PKEuS a8dc17c1d9 Fixed false positive #5566. 2014-08-26 11:29:26 +02:00
PKEuS 77c17100ec Bailout in private function usage checking for operators (#5059). 2014-03-23 10:06:14 +01:00
Alexander Mai 37befc75ef In case of a loop within the class hierarchie Function::isImplicitlyVirtual_rec() was entering an endless loop. Tracking the previously analyzed types shall prevent this. 2014-03-22 08:49:28 +01:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
Daniel Marjamäki d62055277d Fixed #4787 (False Positive: Unused private function) 2014-01-01 18:36:51 +01:00
PKEuS 4f0121ee2f Splitted simplification out of tokenize() 2013-12-30 17:45:28 +01:00
Daniel Marjamäki 80093f0a40 Fixed #4689 (False positive: Unused private function (used in default argument of constructor)) 2013-08-26 16:41:23 +02:00
PKEuS a9a5dc0354 Updated to AStyle 2.03, require this version 2013-08-07 16:27:37 +02:00
Ettl Martin 1b9c1c03fa unittests: removed not needed '\n' at the end of testcases. 2013-03-20 15:36:16 +01:00
PKEuS afe45ff39f Refactorized CheckClass::privateFunctions:
- Resolved todo about nested classes, fixed false negative, fixed wrong unit test
- Removed slow and unnecessary Token::findmatch
- Removed false positive when function implementation in friend class is not seen (#4384)
2013-02-16 01:51:08 -08: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
XhmikosR 3c14e4b52a test: tabs to spaces, remove trailing spaces and extra empty lines at the end of files 2012-09-17 13:51:40 +02:00
PKEuS f5e5d59562 Refactorizations:
- Removed redundant newlines at the end of test cases
- Make use of STL algorithms instead of own implementations of std::replace and std::remove+string::erase
- Removed unused variable (found by cppcheck)
- Prefer postfix increment (found by cppcheck)
2012-07-24 12:21:05 -07:00
PKEuS a93c47988c Restored comment that was modified by accident. 2012-07-09 11:40:49 -07:00
PKEuS 4b3ee97f54 Fixed test failures. 2012-07-09 11:36:28 -07:00
PKEuS 43c060b630 Removed preprocessor directives from tests that aren't preprocessed before being tokenized. 2012-07-07 11:21:08 -07:00
Daniel Marjamäki 26a9a1b571 Fixed #3661 (False positive: unusedPrivateFunction) 2012-04-09 11:19:19 +02:00
PKEuS 9a5f66030c Improved unused private function check:
- Fixed #3628
- Added support for friend
Improved symbol database:
- friend scopes are now set
- Added findScopeByName function
Refactorizations:
- Removed some unnecessary "virtual" keywords
- Removed unnecessary _filename member variable, pass it as argument instead
- Made CppCheck::replaceAll static, since it is independant from a specific CppCheck instance, Pass string to be modified by reference
2012-02-24 20:45:56 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
PKEuS 00d6a0e877 refactorizations for CheckClass and for less false negatives related to derived classes 2011-12-14 21:11:40 +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
Robert Reif 6eecab5d73 fix #2807 (Wrong handling of function references when prefixed with &) 2011-06-29 07:19:34 -04:00
Robert Reif ba6c2ca310 fix #2602 (segmentation fault of cppcheck ( class A {A& operator=(const A&); }; )) 2011-02-22 06:47:28 -05:00
Robert Reif 218464df89 fix #2580 (false postive with Unused private function) 2011-02-14 19:50:13 -05:00
Robert Reif b8c5426bb8 fix #2567 Unused private function when implemented in different file 2011-02-11 08:00:41 -05:00
Daniel Marjamäki 524498e439 Tokenizer: collapse operator function names into a single token. ticket: #2519 2011-01-27 18:44:20 +01:00