<div dir="ltr"><div style>This is with a clang built from trunk head yesterday.</div><div style><br></div><div>When clang is run without objc-gc mode,</div><div>clang defines the symbol __weak as if -fobjc-gc were specified.</div>
<div>clang defines the symbol __strong as empty.</div><div><br></div><div>Here are two commands, the first shows the clang symbols, </div><div>the second shows the warning when a source file wants to define</div><div>__strong and __weak itself.</div>
<div><br></div><div>$ echo | clang -E - -dM | egrep "strong|weak"</div><div><br></div><div>#define __strong </div><div>#define __weak __attribute__((objc_gc(weak)))</div><div><br></div><div>$ clang -E - <<EOF</div>
<div>#define __strong</div><div>#define __weak</div><div>EOF</div><div><stdin>:2:9: warning: '__weak' macro redefined</div><div>#define __weak</div><div> ^</div><div><built-in>:158:9: note: previous definition is here</div>
<div>#define __weak __attribute__((objc_gc(weak)))</div><div> ^</div><div><br></div><div>1 warning generated.</div></div>