I am using Xcode 7.3 and I get a "Ambiguous Macro Extension" warning for a macro that was defined in Foundation, but which I have undefined and overridden in my prefix file. I have modules.
Playback:
- Set "Enable Modules (C and Objective-C)" to "Yes" in the build settings
Use the following prefix file:
#import <Foundation/Foundation.h> #undef assert #define assert(e) NSLog(@"hi") // implementation is not important
Use the following main file:
int main() { assert(42); return 0; }
Then create in Xcode.
- This shows the "Ambiguous extension of the macro warning" assert "in the line of the source file using the macro" assert. " The extension of this definition of "assert" refers to a definition from the system header, not my override. "Another definition of" assert "refers to a definition in my prefix file.
This warning does not occur when modules are disabled.
macros ios compiler-warnings xcode clang
user102008
source share