Re: Can I build gcc so -Wall option is always on ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux