This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: detecting when an option is not available


Vincent Torri <vtorri@univ-evry.fr> writes:

> I would like to know if there is a way to know if a warning option
> like -Wno-initializer-overrides is supported or not by gcc. My purpose
> is to write an m4 macro that checks if an option is supported or not
> by a compiler.

This question is not appropriate for the mailing list gcc@gcc.gnu.org,
which is for the development of GCC itself.  It would be appropriate on
the mailing list gcc-help@gcc.gnu.org.  Please take any followups to
gcc-help.  Thanks.


The trick to find out if a -Wno- option is supported is to force a
compiler error.  E.g.,

echo xx | gcc -Wno-initializer-overrides -x c - -c 2>&1 | grep 'unrecognized command line option'

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]