fork download
  1. #import <objc/objc.h>
  2. #import <objc/Object.h>
  3. #import <Foundation/Foundation.h>
  4.  
  5. @implementation TestObj
  6. int main()
  7. {
  8. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  9.  
  10. NSNumber num = @[NSNumber numberWithFloat: INFINITY];
  11.  
  12. NSLog (@num.stringValue);
  13. [pool drain];
  14. return 0;
  15. }
  16. @end
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.m:6:1: warning: cannot find interface declaration for ‘TestObj’
 int main()
 ^~~
prog.m: In function ‘main’:
prog.m:10:17: error: stray ‘@’ in program
  NSNumber num = @[NSNumber numberWithFloat: INFINITY];
                 ^
prog.m:10:18: error: invalid initializer
  NSNumber num = @[NSNumber numberWithFloat: INFINITY];
                  ^
prog.m:10:2: error: statically allocated instance of Objective-C class ‘NSNumber’
  NSNumber num = @[NSNumber numberWithFloat: INFINITY];
  ^~~~~~~~
prog.m:10:2: error: statically allocated instance of Objective-C class ‘NSNumber’
prog.m:12:9: error: stray ‘@’ in program
  NSLog (@num.stringValue);
         ^
prog.m:12:13: error: ‘struct NSNumber’ has no member named ‘stringValue’
  NSLog (@num.stringValue);
             ^
prog.m:10:11: warning: variable ‘num’ set but not used [-Wunused-but-set-variable]
  NSNumber num = @[NSNumber numberWithFloat: INFINITY];
           ^~~
stdout
Standard output is empty