[cfe-dev] clang does not support extern for OpenCL

Jordan Rose jordan_rose at apple.com
Mon Apr 15 10:44:24 PDT 2013


I'm not familiar with the OpenCL part of the compiler, but I'm pretty sure you're not supposed to invoke -cc1 mode directly, just like the C compiler. The right way to do this is with the usual -std option:

clang -std=cl1.2 tmp.cl

This ensures that all the other driver-specified options get handled appropriately.

Jordan


On Apr 14, 2013, at 16:54 , "Liu, Yaxun (Sam)" <Yaxun.Liu at amd.com> wrote:

> Thanks. I got it.
>  
> For those who are curious, the command line is like
>  
> clang -cc1 -cl-std=CL1.2  tmp.cl
>  
> Sam
>  
> From: Tanya Lattner [mailto:lattner at apple.com] 
> Sent: Friday, April 12, 2013 6:01 PM
> To: Liu, Yaxun (Sam)
> Cc: cfe-dev at cs.uiuc.edu
> Subject: Re: [cfe-dev] clang does not support extern for OpenCL
>  
> You need to set the cl-std value to 1.2. By default its 1.1.
>  
> -Tanya
>  
> On Apr 12, 2013, at 2:40 PM, "Liu, Yaxun (Sam)" <Yaxun.Liu at amd.com> wrote:
> 
> 
> I was trying to compile a simple OpenCL source with clang:
>  
> extern int foo(int, int);
>  
> I got an error msg:
>  
> clang.exe : tmp.cl:1:1: error: OpenCL does not support the 'extern' storage class specifier
>  
> OpenCL spec 1.2 says:
> The typedef, extern, and static storage-class specifiers are supported. 
>  
> Is this a bug? Or did I miss anything? Thanks.
>  
> Sam
>  
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>  
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

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


More information about the cfe-dev mailing list