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

From Robert Haas
Subject Re: Setting -Werror in CFLAGS
Date
Msg-id CA+TgmoZHX8hkZQDC90nGdQY3hvGD9EM9xTejfSVbnyznOF3XRg@mail.gmail.com
Whole thread Raw
In response to Re: Setting -Werror in CFLAGS  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Setting -Werror in CFLAGS  (Peter Geoghegan <peter@2ndquadrant.com>)
Re: Setting -Werror in CFLAGS  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: Setting -Werror in CFLAGS  (Peter Eisentraut <peter_e@gmx.net>)
Re: Setting -Werror in CFLAGS  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On Tue, Jan 3, 2012 at 9:23 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> 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.

I find -Werror to be a convenient way to examine the output for
warnings.  Otherwise they scroll off the screen.  Yeah, I could save
the output to a file and grep it afterwards, but that seems less
convenient.  I'm clearly not the only one doing it this way, since
src/backend/parser/gram.o manually sticks in -Wno-error...

> 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.

Hmm, I guess.  I've never had a problem with anything else that I can
remember, though.

> 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.

I'm not thrilled about that either.  Especially since they seem to be
adding more and more warnings that are harder and harder to work
around for issues that are less and less important.  Unimportant
warnings that are easily avoidable are not so bad, but...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: 16-bit page checksums for 9.2
Next
From: Peter Geoghegan
Date:
Subject: Re: Setting -Werror in CFLAGS