Can I build gcc so -Wall option is always on ?
Ralf Wildenhues
Ralf.Wildenhues@gmx.de
Wed Dec 30 21:41:00 GMT 2009
Hello David,
* Dr. David Kirkby wrote on Thu, Dec 24, 2009 at 05:38:23PM CET:
> I'm helping on the Sage maths project
>
> http://www.sagemath.org/
>
> where there are a large number of packages built, most of which ignore
> CFLAGS. (Quite a few ignore CC and CXX too!) I'd like to display all the
> warnings, but its hard when people overwrite CFLAGS.
>
> Is there a way I can build gcc such that effectively "-Wall" is enabled
> all the time?
I hate to be stating the obvious, but why not use a wrapper script?
mv gcc gcc.real
cat >gcc <<\EOF
#! /bin/sh
exec gcc.real -Wall "$@"
EOF
or just put one early in your $PATH. Depending on your needs, it might
have to be a bit more complex (put -Wall at the end if you care about
overriding -Wno-all and some other flags, for example; or only add -Wall
if -c is also seen, or similarly).
Cheers,
Ralf
More information about the Gcc-help
mailing list