how to exclude third party lib / dll from getting analyzed in CLANG scan-build xcodebuild?

1.6k Views Asked by At

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

There are 1 best solutions below

0
The Godfather On

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