Re: Minor configure tweak to simplify adjusting gcc warnings

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Minor configure tweak to simplify adjusting gcc warnings
Date: 2015-01-14 14:38:41
Message-ID: 20150114143841.GO5245@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-01-14 09:34:23 -0500, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > On 2015-01-13 22:19:30 -0500, Tom Lane wrote:
> >> The reason I got interested in this is that I attempted to pass in
> >> "CFLAGS=-Wno-format" to configure, to suppress format warnings on
> >> buildfarm member gaur (whose gcc is too old to recognize z modifiers).
> >> That doesn't work because -Wall turns the warnings right back on again.
> >> If the user-supplied CFLAGS were inserted after -Wall then it would work.
>
> > In the line of
> > http://archives.postgresql.org/message-id/54B58BA3.8040302%40ohmu.fi in
> > wonder if the better fix isn't to define pg_format_attribute(...) and
> > define it empty that if the compiler doesn't support what we want.
>
> Well, that would only fix my problem if we added a configure-time test
> for whether gcc recognizes "z", which frankly seems like a waste of
> cycles. I've probably got the last one left in captivity that doesn't.

Hm. I had kinda assumed that %z support for sprintf and gcc's
recognition of the format string would coincide and we could just use
the %z result. But gull's output doesn't actually that way.

> >> A slightly more complicated change could be applied to make sure that
> >> *all* of the CFLAGS forcibly inserted by configure appear before any
> >> externally-sourced CFLAGS, allowing any of them to be overridden from the
> >> environment variable. I'm not sure if it's worth the trouble to do that,
> >> but if there's interest I could make it happen.
>
> > I think it'd be good idea, but unless you're enthusiastic I guess there
> > are more important things.
>
> Nah, I'm fine with doing it, it's just a couple more lines of code.
> I feared people might think it wasn't worth adding extra complexity for,
> but as long as someone else likes the idea I'll go do it.

Ok cool. I had thought the templates, subdirectory overrides would make
it slightly less than trivial.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-01-14 14:41:48 Re: hung backends stuck in spinlock heavy endless loop
Previous Message Tom Lane 2015-01-14 14:34:23 Re: Minor configure tweak to simplify adjusting gcc warnings