On Mon, Dec 20, 2010 at 4:20 PM, Tony Wetmore <tony.wetmore@xxxxxxxxxxxx> wrote: > On 12/20/2010 3:55 PM, Jeffrey Walton wrote: >> I'm interested in always using -Wall -Wextra as compile options, and I >> don't want others removing the options. So a make file is out of the >> question. I hope GCC will have something similar to an INI file (in >> /usr/share?), but search results have been heavily polluted with >> "function initialization" results. >> >> Some folks on the team are that lazy or l1t3 - they feel static >> analysis and warnings don't apply to their k3wl code. > > Jeff, > > I have never heard of such a config file for GCC, but you might be able to > re-build the compiler to specify default flags that it should use. Or you > might be able to get what you want by using environment variables with make. > > If you want to use additional flags when you build your project, you can > reference a variable from your Makefile (such as EXTRA_CFLAGS or > USER_CFLAGS). You can then populate that variable in your environment login > script (e.g. .bashrc, .cshrc, whatever). > > Put the flags you want in there and no one else is forced to use them, and > no one can prevent you from using them. So, your Makefile might look > something like: > > .c.o: > $(CC) $(CFLAGS) $(USER_CFLAGS) -c $< Some folks will remove $(USER_CFLAGS) since they have READ/WRITE to the makefile. They have been doing the same for years on Visual Studio projects*. Jeff * Dropping warnings from level 4 from 3, and turning off SAL (http://msdn.microsoft.com/en-us/library/ms235402(v=vs.80).aspx)