Re: Setting -Werror in CFLAGS

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Geoghegan <peter(at)2ndquadrant(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting -Werror in CFLAGS
Date: 2012-01-18 19:38:12
Message-ID: 1326915492.9180.18.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2012-01-18 19:40:29 Re: Setting -Werror in CFLAGS
Previous Message Tom Lane 2012-01-18 19:31:49 Re: Command Triggers