How I like to code

Monthly Archives: April 2012

“Selectively Disable Warnings” with clang

I saw this demo done at WWDC on how to turn off warnings, only when truly warranted, while compiling with clang: #if defined (__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored “-Wunused-value” #endif // defined __clang__ void ImAUselessLittleFunction ( int pleaseUseMe ) { pleaseUseMe; // Nope, you are not going to be used } […]