<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">__weak is always defined for use in blocks. It is unfortunate though that it is def’ed to<div>objc_gc(weak) though. But for the purpose of use, it doesn’t really matter.</div><div><br></div><div>- Fariborz</div><div><br><div><div>On Jun 2, 2013, at 4:57 AM, Frank Rehwinkel <<a href="mailto:frankrehwinkel@gmail.com">frankrehwinkel@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div dir="ltr"><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">This is with a clang built from trunk head a couple of days ago.</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;"><br></div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">When clang is run without objc-gc mode,</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">clang defines the symbol __weak as if -fobjc-gc were specified,</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">clang defines the symbol __strong as empty.</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;"><br></div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">Here are two commands, the first shows the clang symbols, </div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">the second shows the warning when a source file wants to define</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">__strong and __weak itself.</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;"><br></div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">$ echo | clang -E - -dM | egrep "strong|weak"</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;"><br></div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">#define __strong </div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">#define __weak __attribute__((objc_gc(weak)))</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;"><br></div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">$ clang -E - <<EOF</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">#define __strong</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">#define __weak</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">EOF</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;"><stdin>:2:9: warning: '__weak' macro redefined</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">#define __weak</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">        ^</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;"><built-in>:158:9: note: previous definition is here</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">#define __weak __attribute__((objc_gc(weak)))</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">        ^</div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;"><br></div><div style="font-family: arial, sans-serif; font-size: 12.800000190734863px;">1 warning generated.</div></div>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a></div></blockquote></div><br></div></body></html>