* misra: Fix 8.2 false positives
Fix false positives in rule 8.2 that occurred in cases when we have a
function definition and declaration in the same file.
For example, the following code generated false positives before this
commit:
```
void f(uint8_t * const x);
void f(uint8_t * const x)
{ (void)x; }
```
We need to distinguish the declaration and the definition, so the dump
file generation routine was extended to keep token where the definition
of the function. The analysis in the addon also been improved.
Closes Trac issue: https://trac.cppcheck.net/ticket/10219
This commit makes CppcheckData class to use instance attributes instead
of class attributes.
Since class attributes are mutable (list), when you append to them, they
don't promote to instance variable which means when you call parsedump()
multiple times data just gets appended to them.
Found by samed on the forum:
https://sourceforge.net/p/cppcheck/discussion/general/thread/c6e1210ec2/
* parser: Parse standards node at start event
This required, because we can loose data at the end event.
* misra.py: Fix 5.4 standard-dependent error
By default Cppcheck use C11 standard, so this change fix false positives
for rule 5.4 with C99.
* travis: force --std=c89 for misra.py
* addons: Reduce memory consumption
Parse dump files incrementaly using ElementTree.iterparse. Clean unused
resources during parsing. This method is explained in following
article: https://www.ibm.com/developerworks/xml/library/x-hiperfparse/
Memory consumption was reduced about 30% (measured with mprof),
execution time increased about 5% (measured with time utility).
More description available in PR.
* Switch to lxml and update iterparse routines
Use lxml module instead default xml.etree. Lxml provides convenient
wrappers around iterparse method that accepts `tag` argument. That
easer incremental parsing routines to select specific tags from roottree
like `dump` and `dumps`.
Element.clear() method was replaced by `lxml_clean` because lxml
keeps additional information to nodes that should be removed.
Added note about large consumption RAM on large dump files.
This commit doesn't solve this problem completely, but provides a way
to improve current parser to add incremental Configuration serialization
later.
* Working on iterative parser
* Added iterative Configurations parser
* fix
* Fix varlist iteration
* make sure that standards node was loaded
This commit fixes __repr__ methods introduced in d538315268. Fields that recursively links to other cppcheckdata objects was removed to avoid max recursion depth crash on printing.