Created
October 8, 2012 09:11
-
-
Save adaedra/3851553 to your computer and use it in GitHub Desktop.
Objective-C Mangling FAIL !
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Edifice/EdObject.h> | |
#import <stdio.h> | |
@interface Test : EdObject | |
- (void) test: (int) i; | |
- (void) test_; | |
@end | |
@implementation Test | |
- (void) test: (int) i { | |
(void)i; | |
printf("-test:\n"); | |
} | |
- (void) test_ { | |
printf("-test_\n"); | |
} | |
@end | |
int main(void) { | |
Test * test = [[Test alloc] init]; | |
[test test:42]; | |
[test test_]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code compiles fine with Apple's GCC (Just use NSObject instead of EdObject)
But it fails with normal GCC (Tested here with MinGW) :
test.m:18:1: erreur: conflicting types for '-[Test test:]'
test.m:13:1: note: previous definition of '-[Test test:]' was here