Am using the latest clang, checked out today, built on OS X 10.8. Am using it to compile GNUstep. The GNUstep header files implement their own macros for __strong and __weak. clang is being called with -fobjc-runtime=gnustep-1.7 but without -fobjc-arc and without -fobjc-gc.
Why does clang have a builtin definition for __weak in this case? Here is an example of a call to clang and the typical warning message being emitted.
clang GSSSLHandle.m -c -MMD -MP -Wall -Wdeclaration-after-statement -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1 -DGNUSTEP -Wdeprecated-objc-isa-usage -DGNUSTEP_BASE_LIBRARY=1 -fno-strict-aliasing -fexceptions -fobjc-exceptions -D_NATIVE_OBJC_EXCEPTIONS -pthread -dynamic -fno-common -Wall -DGSWARN -DGSDIAGNOSE -Wno-import -g -O2 -fobjc-runtime=gnustep-1.7 -fobjc-runtime=gnustep-1.7 -integrated-as -fconstant-string-class=NSConstantString -I. -I…/Source/. -I…/Source -I…/Headers -I. -I/Users/frank/local/GNUstep/standalone/include -I/Users/frank/local/GNUstep/standalone/include -I/Users/frank/local/GNUstep/standalone/include -I/Users/frank/local/GNUstep/standalone/include -I/usr/include/libxml2 -I/Users/frank/local/GNUstep/standalone/include/ -o obj/SSL.obj/GSSSLHandle.m.o
…/./GNUstepBase/GSConfig.h:403:13: warning: ‘__weak’ macro redefined
define __weak
^
:164:9: note: previous definition is here
#define __weak attribute((objc_gc(weak)))
^
1 warning generated.
Thank you,
-Frank