Added new suppress comments:
- `cppcheck-suppress-begin` and `cppcheck-suppress-end` to remove blocks
of suppression
- `cppcheck-suppress-file` to remove suppression at file level
The suppressions do not interfere with each others. For example, all the
suppressions are matched in the following code:
```c
// cppcheck-suppress-file uninitvar
void f() {
int a;
// cppcheck-suppress-begin uninitvar
// cppcheck-suppress uninitvar
a++;
// cppcheck-suppress-end uninitvar
}
```
Tickets:
https://trac.cppcheck.net/ticket/11902https://trac.cppcheck.net/ticket/8528
* Suppressions: merged `isSuppressedLocal()` into `isSuppressed()`
* avoid some unnecessary copies when adding suppressions
* TestSuppressions: improved readability of multiple line string literals
* supressions.h: got rid of unnecessary copy and assignment operators for `Suppressions::Suppression` - fixes `performance-move-const-arg` clang-tidy warning
* TestSuppressions: cleaned up a variable construction
* 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
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.