Re: Setting -Werror in CFLAGS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Peter Geoghegan <peter(at)2ndquadrant(dot)com>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Setting -Werror in CFLAGS
Date: 2012-01-04 02:23:19
Message-ID: 1993.1325643799@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Tue, Jan 3, 2012 at 7:39 PM, Peter Geoghegan <peter(at)2ndquadrant(dot)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.err
cat make.err

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-01-04 02:28:16 Re: pg_internal.init and an index file have the same inode
Previous Message Robert Haas 2012-01-04 02:22:22 Re: Standalone synchronous master