Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress "macro redefined" warning in Objective-C

I need to redefine a macro in my project and have a compile warning. I've tried

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wall"
#define SomeMacroToRedefine MyMacro
#pragma clang diagnostic pop

But it doesn't really work and I still have a warning. Any other ideas how to fix it?

like image 278
Maxim Lavrov Avatar asked Nov 26 '14 12:11

Maxim Lavrov


1 Answers

You should consider using a unique identifier instead.

This warning apparently has no identifier in the Xcode 6.1 distribution.

You can #undef prior to your definition:

#undef SomeMacroToRedefine
#define SomeMacroToRedefine MyMacro
like image 120
justin Avatar answered Oct 04 '22 14:10

justin