[cfe-dev] Objective-C Boxed Expressions Error: unexpected '@' in program

Charalampos Chrysovalantis Emmanouilidis chrys.emmanouilidis at gmail.com
Mon Dec 3 22:05:08 PST 2012


I'm trying to compile some Boxed Expressions with clang 3.1

##
# Clang Version
##
charemma $ clang --version
Debian clang version 3.1-5ppa1 (branches/release_31) (based on LLVM 3.1)
Target: i386-pc-linux-gnu
Thread model: posix

##
# Sample code in main.c
##
NSString *path = @(getenv("PATH"));
NSLog(@"PATH %@", path);


##
# compiler usage
##
charemma$ clang  -x objective-c -I/opt/GNUstep/include  -o main.c.o  -c
main.c
main.c:10:22: error: unexpected '@' in program
    NSString *path = @(getenv("PATH"));
                     ^
1 error generated.

Do I need to pass any specific flag to clang to get support for Boxed
Expressions like @(getenv("PATH"))?

According to this article
http://clang.llvm.org/docs/ObjectiveCLiterals.html this
should be supported starting with clang v3.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121204/5d7565f2/attachment.html>


More information about the cfe-dev mailing list