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

From Peter Eisentraut
Subject Re: Setting -Werror in CFLAGS
Date
Msg-id 1326915492.9180.18.camel@vanquo.pezone.net
Whole thread Raw
In response to Re: Setting -Werror in CFLAGS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On tis, 2012-01-03 at 21:23 -0500, Tom Lane wrote:
> 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.

Well, cite your source. ;-)  Proper software development practices, as I
understand them, is that there is one command to build the thing, and
that either fails or it doesn't.  If we rely on people to read the build
log, then we've lost already.

The only particular case where this doesn't work that I can think of is
that you need to examine the flex output for warnings.  But that is very
isolated.  If you don't change the scanner source files (and perhaps one
or two other things, or if you change the build system itself), then
relying on the exit status of make should be enough.  If not, we need to
fix that.

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

That's why -Werror should never be the default for a postgresql build,
but that doesn't mean that we can't make it a useful optional tool.

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

As a side note: I tested gcc 4.7 a few weeks ago and it doesn't
introduce any new warnings.  Of course, it's not final yet, but it's
pretty close.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Command Triggers
Next
From: Peter Eisentraut
Date:
Subject: Re: Setting -Werror in CFLAGS