// gcc -framework Foundation -fobjc-exceptions -Os -arch i386 -Wextra volatile.m // // volatile.m:36: warning: variable 'thePoint' might be clobbered by 'longjmp' or 'vfork' // gcc -framework Foundation -fobjc-exceptions -Os -arch ppc -Wextra volatile.m // gcc -framework Foundation -fobjc-exceptions -Os -arch i386 volatile.m // gcc -framework Foundation -fobjc-exceptions -Os -arch i386 -Wextra -D MY_VAR_IS_VOLATILE volatile.m // // no warning #import struct MyPoint { float x; float y; }; @interface MyObject : NSObject {} +(void) doNothingWithPoint:(struct MyPoint)aPoint; @end @implementation MyObject +(void) doNothingWithPoint:(struct MyPoint)aPoint {} @end int main(int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; @synchronized(pool) { #ifdef MY_VAR_IS_VOLATILE volatile struct MyPoint thePoint; #else struct MyPoint thePoint; #endif thePoint.x = 0.0; thePoint.y = 0.0; [MyObject doNothingWithPoint:thePoint]; } [pool release]; return 0; }