[cfe-dev] Instance variables in implementation error?

Marcel Weiher marcel.weiher at gmail.com
Tue Jul 5 02:03:28 PDT 2011


On Jul 4, 2011, at 18:41 , Fariborz Jahanian wrote:

>> I am working on a code-base that for various reasons has instance variables declared in both the @interface and the @implementation section.  Using gcc 4.2, this is OK, but clang in 64 bit aborts with the following error:
>> 
>> [..]
>> In 32 bit mode, clang is OK with this, as is gcc 4.2 in both 32 bit and 64 bit mode.  Any way to turn this error off in clang 64 bit mode?
> 
> -m64 uses the non-fragile abi. This mode has a few language extensions, one of which is allowing to add 'private' ivars
> to the class via @implementation. So, each ivar is checked against existing ivars and diagnostic is issued for a redeclaration.

Yep.

> You can work around this problem by adding -fno-objc-nonfragile-abi to your command line. But I should caution that 
> we don't test nonfragile-abi in 64bit mode. And you may likely run into other issues.


Ahh, that was the flag I was looking for!  Tried it and the errors go away, except that the linker now fails (without even an error message).  Which makes sense considering all the libs it is trying to link against were almost certainly compiled with the non-fragile ABI...so I guess I should have seen that one coming.

Thanks for the pointer, learn something new every day!

Marcel

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


More information about the cfe-dev mailing list