[cfe-dev] clang options

Jean-Daniel Dupas devlists at shadowlab.org
Fri Nov 20 11:39:30 PST 2009


Le 20 nov. 2009 à 20:18, John Thompson a écrit :

> How to force clang to compile a file as C++?
>  
> I tried:
>  
> clang -Xclang "-x=c++" -fsyntax-only file.c
> but I get the error:
>  
> clang-cc.exe: for the -x option: may only occur zero or one times!
>  
> Is this a general problem with the driver in that options passed with -x don't supercede those provided by the driver?
>  
> I tried:
>  
> clang -Xclang="-x=c++" -fsyntax-only file.c
> but it apparently ignored the argument.
>  
> I tried:
>  
> clang -ccc-cxx -fsyntax-only file.c
>  
> but it still compiles it as C.

What about

clang -x c++ main.c

-- Jean-Daniel








More information about the cfe-dev mailing list