Re: s_lock.h default definitions are rather confused

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: s_lock.h default definitions are rather confused
Date: 2015-01-14 22:59:19
Message-ID: 20150114225919.GY5245@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2015-01-14 12:27:42 -0500, Robert Haas wrote:
> On Mon, Jan 12, 2015 at 12:57 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> > On 2015-01-10 23:03:36 +0100, Andres Freund wrote:
> >> On 2015-01-10 16:09:42 -0500, Tom Lane wrote:
> >> > I've not tried to build HEAD on my HPPA dinosaur for awhile, but I did
> >> > just now, and I am presented with boatloads of this:
> >> >
> >> > ../../../src/include/storage/s_lock.h:759: warning: `S_UNLOCK' redefined
> >> > ../../../src/include/storage/s_lock.h:679: warning: this is the location of the previous definition
> >> >
> >> > which is not too surprising because the "default" definition at line 679
> >> > precedes the HPPA-specific one at line 759.
> >>
> >> That's 0709b7ee72e4bc71ad07b7120acd117265ab51d0.
> >>
> >> Not too surprising that it broke and wasn't noticed without access to
> >> hppa - the hppa code uses gcc inline assembly outside of the big
> >> defined(__GNUC__) and inside the section headed "Platforms that use
> >> non-gcc inline assembly".
> >>
> >> > I'm not particularly interested in untangling the effects of the recent
> >> > hackery in s_lock.h enough to figure out how the overall structure got
> >> > broken, but I trust one of you will clean up the mess.
> >>
> >> I think it's easiest solved by moving the gcc inline assembly up to the
> >> rest of the gcc inline assembly. That'll require duplicating a couple
> >> lines, but seems easier to understand nonetheless. Not pretty.
> >
> > Robert, do you have a better idea?
>
> How about hoisting the entire hppa section up to the top of the file,
> before the __GNUC__ || __INTEL_COMPILER section?

We could do that, but I'd rather not see that uglyness at the top
everytime I open the file :P

Right now I think a #ifdef/undef S_UNLOCK in the relevant gcc section
sufficient and acceptable. It's after all the HPPA section that doesn't
really play by the rules.

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 Kouhei Kaigai 2015-01-14 23:02:56 Re: Custom/Foreign-Join-APIs (Re: [v9.5] Custom Plan API)
Previous Message Andres Freund 2015-01-14 22:54:52 Re: __attribute__ for non-gcc compilers