<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 3, 2011, at 2:33 PM, Marcel Weiher wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi folks,<div><br></div><div>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:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; ">[elided] ../../src/Error.m:13:10: error: instance variable is already declared [3]</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; ">     BOOL _isExceptional;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; text-indent: -12px; font: normal normal normal 11px/normal Menlo; ">          ^</div></div><div><br></div><div>Which is true, that is exactly what's happening, it was just OK (if questionable) before.</div><div><br></div><div>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?</div></div></blockquote><div><br></div>-m64 uses the non-fragile abi. This mode has a few language extensions, one of which is allowing to add 'private' ivars</div><div>to the class via @implementation. So, each ivar is checked against existing ivars and diagnostic is issued for a redeclaration.</div><div>You can work around this problem by adding -fno-objc-nonfragile-abi to your command line. But I should caution that </div><div>we don't test nonfragile-abi in 64bit mode. And you may likely run into other issues.</div><div><br></div><div>- fariborz</div><div><br></div><div><br></div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>I tried setting the Objective-C language level using the (gcc) flag  '<span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">-fobjc-std=objc1'</span> but that doesn't seem to make a difference.  I did a search of the clang pages at   <a href="http://clang.llvm.org/docs/UsersManual.html">http://clang.llvm.org/docs/UsersManual.html</a>  but the link to "Objective-C language features" is a dead link ( <a href="http://clang.llvm.org/docs/UsersManual.html#objc">http://clang.llvm.org/docs/UsersManual.html#objc</a> ), as is the C++ link.  The C language features link works.</div><div><br></div><div>I also tried to search the code via the error message, but that wasn't too illuminating either.</div><div><br></div><div>For now, I can probably get by with using gcc 4.2, but I'd much prefer to use clang.</div><div><br></div><div>Thanks!</div><div><br></div><div>Marcel</div><div><br></div></div>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></blockquote></div><br></body></html>