[cfe-dev] Clang driver

Eric Christopher echristo at apple.com
Wed Jun 22 22:42:57 PDT 2011


On Jun 22, 2011, at 7:00 PM, Marcin Zalewski wrote:

> OK. But should the driver totally ignore unknown flags, or should it
> pass them to the tool it calls?
> 
> clang -cc1 -finvalidflag some_file.cpp
> 
> The above command gives the following error:
> 
> error: unknown argument: '-finvalidflag'
> 
> What happened to me was that I added a flag to cc1. Everything was
> working correctly until I actually tried to use the driver. It was
> silently eating up my flag. Only after examining the output of "-v" I
> notice that my flag disappears, and then I added proper support for
> the flag in the driver. In case of some other options (not flags), I
> at least get a warning:
> 

Yes. You need to add it to the driver as well.

> clang -auao testt.cpp
> clang: warning: argument unused during compilation: '-auao'
> 
> but
> 
> clang -invalidoption testt.cpp
> 
> gives no warning. As an "outsider," I was confused by some options
> giving warnings and some not.
> 

Yes. Some options missing will give warnings, others won't. Largely based
on the character they start with :)

Again, this is to make transitioning easier - unfortunately it makes
adding options more painful at the moment.

-eric




More information about the cfe-dev mailing list