You can let Cppcheck output the errors and other messages with the corresponding id, severity (what you call category) and more info in an XML format via the command line ./cppcheck --errorlist
Hi, i have found code like the following in a project and get a warning by Cppcheck which i do not know is correct. The code is like this simplified version: #include <utility> class Base { public: int m_Base = 0; Base() = default; virtual ~Base() = default; }; class Derived : public Base { public: int m_Foo = 0; Derived() : Base() {}; Derived& operator=(Derived&& src) { if (&src != this) { Base::operator=(std::move(src)); m_Foo = src.m_Foo; } return *this; } }; For the line 21 where it says m_Foo...
Here is another very interesting article about issues with mmap(): https://www.golem.de/news/mmap-codeanalyse-mit-sechs-zeilen-bash-2006-148878.html It is also in german but it should be no problem to machine translate it. They also mentioned that no compiler, even with the new analysis functionality, and also Cppcheck did not find the bug. I know that such a check is not yet possible with Cppcheck, but maybe it is useful to add it.
Great, thanks for the feedback.
The download links on http://cppcheck.net/ still lead to the binaries for version 1.90 instead of 2.0.
This should have been fixed with this commit: https://github.com/danmar/cppcheck/commit/e17863c216c4f411fcb5b2203e827c9a986edd0a#diff-09c3865dea9f703907ed99c5590d4688 The fixed version of cppcheck-htmlreport script will be part of the next release. I suggest to download the fixed script and verify if it works for you then: https://github.com/danmar/cppcheck/blob/master/htmlreport/cppcheck-htmlreport
I do not know. At least I did not stumble about any binaries yet.
Hmm, maybe. All the other similar messages that are caused by invalid options directly quit Cppcheck with the error message. This specific error message is an exception, the analysis still starts and only this hint is printed. Adding this as a global error to the XML file could be useful. Maybe @danielmarjamaki has an opinion about that.