how to use #pragma clang diagnostics how to use #pragma clang diagnostics xcode xcode

how to use #pragma clang diagnostics


Right click on the issue in the issue navigator and select "Reveal in Log". The error message will specify the warning.


You can look up the warning command line parameter if you know the message: Diagnostic flags in Clang


Ok, then this is what I understood

Clang is the C/Objective C Front end Layer for compiler.and Clang take the responsibility of showing Warning and Error message that we see in Xcode.

So when you enable the option of treat your warning as Error in Xcode,In some cases you need a tool to work around about the Clang to allow some warnings..

and here Clang Diagnostics play that role..

and the mechanism for that is like Graph Matrix, which is happened in Stack way..Push and Pop..

so when you have something like this..

#pragma clang diagnostic push

#pragma clang diagnostic ignored "-Wcovered-switch-default"

// Code.........

#pragma clang diagnostic pop

you are preventing Clang to show warning messages on that area, so it something like SafeArea..