clang-scanbuild new feature proposal

7 views
Skip to first unread message

b...@mojatatu.com

unread,
Feb 2, 2018, 10:29:13 AM2/2/18
to Jenkins Developers
I propose to add an option to scan-build to ignore problem reports containing certain strings (user-specified list of strings to ignore) in certain parts of the problem report.

Rationale and explanation:

We use clang-scanbuild to find problems in our codebase.  But it finds problems related to a package we use, uthash that we have determined are not problems.  We are not prepared to change the uthash package, so we want to ignore those error reports.

I noticed that clang-scanbuild produces a html-file per error, containing the marked-up source code of the source file containing the error.  The actual error line is indicated, along with (potentially) a series of other lines where assumptions were made ("events") about the state of the program leading to the error.  In the uthash problem reports, the last one of these events always mentions a string related to uthash such as HASH_DEL.

So my proposed feature will allow us to specify a set of strings to ignore, and when those strings appear in the last of the series of "events" that lead to an error, then that error will not be included in the error summary.

Does this sound useful to the community?  Shall I upload it?  I still need to make some tests.

Testing

For testing, I was thinking of making some html files with and without the strings to find, and seeing if the summary contains the right errors ... does that sound like a good approach?  I will have to make a sample program, I should not use our unreleased code for this.  Any advice on the testing will be welcome.

bjb

Oleg Nenashev

unread,
Feb 3, 2018, 8:46:53 AM2/3/18
to Jenkins Developers
The proposed feature seems to be feasible. I would suggest creating a pull request and discussing it with the plugin maintainer.


For testing, I was thinking of making some html files with and without the strings to find, and seeing if the summary contains the right errors ... does that sound like a good approach?  I will have to make a sample program, I should not use our unreleased code for this.  Any advice on the testing will be welcome.

Yeah, it would work well for unit testing. Jenkins Test Harness framework offers the tooling you may need for that. You can also just attach generated sample HTML files as test resources to the plugin.

BR, Oleg

пятница, 2 февраля 2018 г., 16:29:13 UTC+1 пользователь b...@mojatatu.com написал:
Reply all
Reply to author
Forward
0 new messages