Re: Setting -Werror in CFLAGS - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Setting -Werror in CFLAGS
Date
Msg-id 1993.1325643799@sss.pgh.pa.us
Whole thread Raw
In response to Re: Setting -Werror in CFLAGS  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Setting -Werror in CFLAGS  (Robert Haas <robertmhaas@gmail.com>)
Re: Setting -Werror in CFLAGS  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Jan 3, 2012 at 7:39 PM, Peter Geoghegan <peter@2ndquadrant.com> wrote:
>> Yes, I know that these only appeared in GCC 4.6+ and as such are a
>> relatively recent phenomenon, but there has been some effort to
>> eliminate them, and if I could get a non-hacked -Werror build I'd feel
>> happy enough about excluding them as already outlined.

> I just do this:
> echo COPT=-Werror > src/Makefile.custom
> ...which seems to work reasonably well.

I see no point in -Werror whatsoever.  If you aren't examining the make
output for warnings, you're not following proper development practice
IMO.  gcc is not the only tool we use in the build process, so if you
are relying on -Werror to call attention to everything you should be
worrying about, you lost already.

I'm also less than thrilled with the idea that whatever the gcc boys
decide to make a warning tomorrow will automatically become a MUST FIX
NOW for us.  If you don't see why this is a problem, try building any
PG release more than a few months old on latest and greatest gcc.
(Of note here, latest-and-greatest is changing again this week, at least
for Fedora, and I fully expect 4.7 to start whinging about things we
never heard of before.)  Moving-target warnings are one thing,
moving-target hard errors are another thing entirely.

Personally I tend to do something like
make -j4 >make.out 2>make.errcat make.err
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Standalone synchronous master
Next
From: Tom Lane
Date:
Subject: Re: pg_internal.init and an index file have the same inode