[cfe-dev] clang defines __weak as if -fobjc-gc were specified

John McCall rjmccall at apple.com
Wed Jun 5 10:06:02 PDT 2013


On Jun 5, 2013, at 10:04 AM, Frank Rehwinkel <frankrehwinkel at gmail.com> wrote:
> Thanks for asking.  I just want to make sure I understand your statement and question.  On Darwin, you've always had __weak defined as __attribute__((objc_gc(weak))), even when __strong is defined as <empty>?
> 
> If it is intentional, then I would say there is no specific problem.  We can put a comment into the header file for GNUstep to explain why __weak is being undef'ed before it is defined as <empty>.  (Without the undef, the build generates seemingly hundreds of warnings, obscuring other warnings that might be more meaningful.)
> 
> If it is unintentional, then a change to clang would obviate the additional code in the GNUstep header and save a few seconds every time someone went to read through the logic of those __strong and __weak macro definitions.

Why don't you just not #define __weak and __strong on Darwin?

John.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130605/83a0d916/attachment.html>


More information about the cfe-dev mailing list