<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Look like you're using an old clang version.<div><br></div><div>What clang --version reports ? </div><div><br></div><div><br><div><div>Le 5 déc. 2012 à 18:47, Charalampos Emmanouilidis <<a href="mailto:chrys.emmanouilidis@gmail.com">chrys.emmanouilidis@gmail.com</a>> a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Tried both compile flags as you suggested:<div><br><div><br></div><div><b>#-fobjc-nonfragile-abi</b></div><div><div>charemma$ clang  -x objective-c -I/opt/GNUstep/include -fobjc-nonfragile-abi -o main.c.o  -c main.c</div><div>main.c:10:22: error: unexpected '@' in program</div><div>    NSString *path = @(getenv("PATH"));</div><div>                     ^</div><div>1 error generated.</div></div><div><br></div><div><br></div><div><br></div><div><b># -fobjc-runtime=gnustep, please note, this flag is not even recognized</b></div><div><div>charemma$ clang  -x objective-c -I/opt/GNUstep/include -fobjc-runtime=gnustep -o main.c.o  -c main.c</div><div>clang: warning: argument unused during compilation: '-fobjc-runtime=gnustep'</div><div>main.c:10:22: error: unexpected '@' in program</div><div>    NSString *path = @(getenv("PATH"));</div><div>                     ^</div><div>1 error generated.</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><div><br></div><div><br><div><div>On Dec 4, 2012, at 10:04 AM, David Chisnall <<a href="mailto:David.Chisnall@cl.cam.ac.uk">David.Chisnall@cl.cam.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">The new syntax is only supported with the non-fragile ABI.  Please add either -fobjc-nonfragile-abi or -fobjc-runtime=gnustep to your compile flags.<br><br>The new ABI is the default on *BSD, however clang defaults to the GCC ABI on GNU platforms for greater compatibility with legacy Objective-C implementations.<br><br>David<br><br>On 4 Dec 2012, at 06:05, Charalampos Chrysovalantis Emmanouilidis wrote:<br><br><blockquote type="cite">I'm trying to compile some Boxed Expressions with clang 3.1<br><br>##<br># Clang Version<br>##<br>charemma $ clang --version <br>Debian clang version 3.1-5ppa1 (branches/release_31) (based on LLVM 3.1)<br>Target: i386-pc-linux-gnu<br>Thread model: posix<br><br>##<br># Sample code in main.c<br>##<br>NSString *path = @(getenv("PATH"));<br>NSLog(@"PATH %@", path);<br><br><br>##<br># compiler usage<br>##<br>charemma$ clang  -x objective-c -I/opt/GNUstep/include  -o main.c.o  -c main.c<br>main.c:10:22: error: unexpected '@' in program<br>    NSString *path = @(getenv("PATH"));<br>                     ^<br>1 error generated.<br><br>Do I need to pass any specific flag to clang to get support for Boxed Expressions like @(getenv("PATH"))?<br><br>According to this article <a href="http://clang.llvm.org/docs/ObjectiveCLiterals.html">http://clang.llvm.org/docs/ObjectiveCLiterals.html</a> this should be supported starting with clang v3.1<br>_______________________________________________<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><br></blockquote><br></blockquote></div><br></div></div></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><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div>-- Jean-Daniel</div><div><br></div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br></div></body></html>