CppCheck configuration

Maarten Hoes hoes.maarten at gmail.com
Sat Sep 26 12:47:56 PDT 2015


Hi,


On Sat, Sep 26, 2015 at 6:14 PM, Michaël Lefèvre <lefevre00 at gmail.com>
wrote:

> 1. there is a 'missingConfig' error, recommanding us to run the check with
> --checkconfig
>
Im assuming you meant 'missingInclude' here, and not 'missingConfig' ? (I
couldnt find a 'missingConfig'). If I remember correctly, there are
cppcheck options to make it look in additional (sub-)directory's for header
files. I actually tried that option, but couldnt get it to work properly,
not even when I included the directory's that contained the right header
files. So I abandoned that approach. Feel free to try out those options and
improve the script.
;)


2. we could minimized the results by removing check on qa sub-directories,
> which are supposed to be the place for unit tests.
>
Again, if I recall correctly, there's an '-i directory' option that lets
you exclude certain directory's. So I guess it would be pretty easy to do
something like this : 'cppcheck -i qadir1 -i qadir2 -i qadir3'.



> 3. if you use a suppression-list to silence some reports, may be this one
> could be in the git repository so we can use it localy.
>
There is a switch that determines what kind of 'bugs' to report on. I think
that it is currently set to '--enable=all', and guess you could specify
only certain types of bugs to report on using that.

I dont actually remember options to specify specific pieces of code to
exclude; but then again, the man page says this :

--suppress=<spec>

    Suppress a specific warning. The format of <spec> is: [error
id]:[filename]:[line]. The [filename] and [line] are optional. [error id]
may be * to suppress all warnings (for a specified file or files).
[filename] may contain the wildcard characters * or ?.

--suppressions-list=<file>

    Suppress warnings listed in the file. Each suppression is in the format
of <spec> above.


Which I guess could do what you want, but you would have to manually
administer that suppression list which you may not want to do.



> By the way, thank you for bringing this idea to reality.
>
No problem, I liked doing it, and was glad that I could contribute to the
LibreOffice project even though I cant write C/C++.




Hope this helps,


- Maarten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20150926/2a01f6db/attachment.html>


More information about the LibreOffice mailing list