9

I have used some open-source code and third party libs in my project and want to exclude that code from getting analyzed while analyzing my project using scan-build file. I know we can #ifndef clang_analyzer use this macro to suppress the code from getting analysed, but I dont want to copy paste this in all the files.

OR Is there any way so that the report which get generated after analysis using scan-build command, not to show the warnings/error generated from some set of files?

thanks in advance.

1 Answers1

0

Use --exclude [1] [2] option (available since 2018)

--exclude

Do not run static analyzer against files found in this directory (You can specify this option multiple times). Could be useful when project contains 3rd party libraries.

Same is applicable for Python implementation of scan-build ($ pip install scan-build) - https://github.com/rizsotto/scan-build

The Godfather
  • 4,235
  • 4
  • 39
  • 61