Commit Graph

50 Commits

Author SHA1 Message Date
Daniel Marjamäki 1cd16cf94f Suppressions: Handle comment in file that starts with # 2019-01-12 15:21:47 +01:00
Daniel Marjamäki 7db671fee6 Suppressions::NO_LINE : fixed comparisons 2018-09-23 16:50:51 +02:00
shikamu 83cb0b3394 --suppress on line 0 (#1354)
Fixed --suppress on line 0
2018-09-18 12:58:14 +02:00
Daniel Marjamäki e442bc47b1 astyle formatting
[ci skip]
2018-08-17 19:55:21 +02:00
Konrad Grochowski 0e70c8a916 Added '-' and '.' to allowed chars in error ids for suppressions. (#1338)
Those chars are used for example in misra.py
2018-08-17 08:20:39 +02:00
Daniel Marjamäki 518dd8bfa3 Refactoring: Use range for loops 2018-07-15 14:51:33 +02:00
Pavel Pimenov c25ab16f5d V817 It is more efficient to seek '\t' character rather than a string. errorlogger.cpp 448 (#1290)
V817 It is more efficient to seek '}' character rather than a string. errorlogger.cpp 484
V817 It is more efficient to seek '\r' character rather than a string. errorlogger.cpp 497
V817 It is more efficient to seek '\r' character rather than a string. errorlogger.cpp 528
V817 It is more efficient to seek ';' character rather than a string. suppressions.cpp 187
V817 It is more efficient to seek ';' character rather than a string. suppressions.cpp 188

full log: http://www.fly-server.ru/pvs-studio/cppcheck/
2018-06-17 16:39:28 +02:00
Daniel Marjamäki 37bcec8804 Renamed _fileName 2018-06-17 08:19:10 +02:00
Daniel Marjamäki 8d66eecf47 Renamed _suppressions to mSuppressions 2018-06-17 08:16:37 +02:00
Daniel Marjamäki 45379a3aa6 Updated copyright year for modified files
[ci skip]
2018-06-10 22:07:21 +02:00
Daniel Marjamäki 03b2e0eee7 inline suppressions: treat arithmetic operators as start-of-comment 2018-06-09 22:50:51 +02:00
orbitcowboy 33777c5b72 Improved const correcntess of local variables. 2018-05-29 13:24:48 +02:00
Daniel Marjamäki 1e7c1841f7 Fixed #8515 (Wrong info message about unmatched suppression) 2018-05-11 09:01:24 +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 a0c9de0048 Suppressions: Validate inline suppressions 2018-04-11 08:18:00 +02:00
Daniel Marjamäki 87557afc43 Suppressions: Better XML formatting 2018-04-10 16:32:47 +02:00
Daniel Marjamäki a2b8eb7405 Suppressions: Report error if bad suppression element is used 2018-04-10 16:26:00 +02:00
Daniel Marjamäki e6114a2321 glob patterns: wildcards also match path separators (like before) 2018-04-09 18:59:18 +02:00
Daniel Marjamäki a0906140a6 Suppressions: New extensible Suppressions xml format that allow more attributes. To start with it also allows symbolName. 2018-04-09 06:43:48 +02:00
jrp2014 b6504c70ca Improve constness 2018-04-04 21:51:31 +02:00
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 37afc57a2a Fixed #7455 (Suppressions: not working well with windows path separators) 2016-05-23 15:38:47 +02:00
PKEuS c831577322 Removed handling of misspelled error ID stlBoundaries in Suppressions 2016-01-31 14:06:47 +01:00
Lauri Nurmi 996c9244d8 Update copyright year to 2007-2016. 2016-01-01 15:34:45 +02:00
PKEuS e8522c7883 Small refactorizations:
- #include cleanup
- Use std::array instead of std::vector
- Do not create a stringstream to concatenate 4 strings
- Use std::cout instead of printf
2015-11-29 10:56:44 +01:00
Daniel Marjamäki 0f9d90d2be Changed Copyrights. Removed my name. 2015-11-18 20:04:50 +01:00
PKEuS 1627b19dd6 Refactorizations:
- Call std::string::find() with char instead of char* where possible
- Avoid string copying
- Optimized several Token::tokAt/strAt calls
2015-08-16 10:33:51 +02:00
Dmitry-Me 769d8e713d Eliminate repeated lookup, better variable names 2015-08-13 16:10:23 +03:00
Thomas Jarosch ec21134817 Fix false negatives for local suppressions
Introduce a new bool setting jointSuppressionReport
that will be set by the analyseWholeProgram() code path.

When the flag is enabled, unmatched suppressions are
collected after running the final whole program analysis
to prevent false positives for the unusedFunction check.

The check functions in the unit test
for single / multi file suppressions were unified.
2015-01-20 18:47:30 +01:00
Thomas Jarosch 4248c94d87 Silence compiler warning about unused parameter
PKEuS should decide if we can drop the parameter altogether.
2015-01-07 16:30:30 +01:00
Thomas Jarosch 2cb2161c5d Fix unmatched local suppression error message for "unusedFunction" (#6228)
This fixes a regression from commit
e35329aba3
(fix for #4946)
2015-01-07 15:40:12 +01:00
Daniel Marjamäki ff11ba9847 Updated copyright year to 2015 2015-01-03 12:14:58 +01:00
PKEuS e35329aba3 Fixed reporting of unmatched suppressions for unusedFunction (#4946) 2014-09-01 10:13:03 +02:00
PKEuS e9411e05ba Refactorized inefficient usage of std::string and const char[]. 2014-04-02 13:56:34 +02:00
Daniel Marjamäki fd3a8a2a18 Update copyright 2014-02-15 07:45:39 +01:00
PKEuS 2333aa2cc7 Don't use native separators for suppression matching 2013-03-12 07:53:18 -07:00
Andrew C. Martin bd0d9b9639 fix misspellings & gcc v3.4.6 warnings
1.  fix typos / misspellings
 - Fix misspelling within comments, variable/function names, stdout messages
 - changes the name of an error code: ```stlBoundries``` changed to ```stlBoundaries```.  Alias old name (```stlBoundries```) to the new one.

2.  fix gcc v3.4.6 32bit & 64bit warnings

 - fixes gcc v3.4.6 warnings, except for those in tinyxml and "-Wmissing-declarations" makefile warnings
 - in Preprocessor::handleIncludes(), replace a ```vector <bool>``` with ```stack<bool>``` (see ```vector<bool>``` warning below).
   - this is the only ```vector<bool>``` in the codebase
 - ```vector <bool>``` is actually a case of template specialization, and is not recommended, according to the following links:

http://stackoverflow.com/q/6461487
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2160.html
http://stackoverflow.com/q/670308

 - in the codebase before and after this change, testrunner SEGVs in a number of places on gcc v3.4.6, including ```Check::~Check()```, among others
   - fc42fc95 fixes this particular runtime issue for DJGPP & __sun
2013-02-09 23:43:09 -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
Daniel Marjamäki 865c0205e3 Fixed #4210 (Unmatched suppression warning emitted from disabled check) 2012-09-23 10:56:12 +02:00
XhmikosR 6e4e3dfbfb lib: tabs to spaces, remove trailing spaces and extra empty lines at the end of files 2012-09-17 13:51:23 +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 2c9545f603 Fixed #3797: _ is a valid character in suppression IDs 2012-07-06 09:16:43 -07:00
PKEuS 4b52df675a Some refactorizations 2012-02-18 14:44:04 +01:00
Reijo Tomperi 8cae17fda8 Update year to 2012 2012-01-01 01:05:37 +02:00
PKEuS dca03c3ce2 Remove unnecessary includes
Also add a unit test related to #3427
Also improve the description text in checkclass and remove unused variable.
2011-12-23 23:31:48 +02:00
Daniel Marjamäki 6f8e42a5af changed the astyle formatting flags 2011-10-13 20:53:06 +02:00
Kimmo Varis 71778095c6 Compile fix. 2011-08-22 20:21:25 +03:00
Kimmo Varis 716679ec7d Move Suppressions class to own source files.
I want to use Suppressions class also in GUI. And that is easier
to do when it is not internal class of Settings class. And in
general is it more natural that Settings class only contains list
of suppressions and implementation is separate.
2011-08-22 19:57:28 +03:00