Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When using Xcode analysis (product>analyze) is there a way of ignoring any errors in a given file?

When using Xcode analysis (product>analyze) is there a way of ignoring any errors in a given file?

Eg a pragma or something?

We just want to ignore any warnings on third party code, so that it's more obvious to us when there's a problem in our code.

Thanks

like image 420
Chris Avatar asked Oct 24 '22 11:10

Chris


2 Answers

As suggested by matthew:

#ifndef __clang_analyzer__ 
...
#endif
like image 126
Chris Avatar answered Nov 15 '22 10:11

Chris


#pragma clang diagnostic ignored "-Wall"

See the clang user's manual for other useful related #pragmas for clang.

This also works for GCC.

#pragma GCC diagnostic ignored "-Wall"
like image 27
zpasternack Avatar answered Nov 15 '22 08:11

zpasternack