Re: warning when compiling utils/tqual.h

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: warning when compiling utils/tqual.h
Date: 2014-03-17 16:55:13
Message-ID: 20140317165513.GH16438@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-03-17 12:50:37 -0400, Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > I noticed (by running "cd src/include ; make check" with the attached
> > patch applied) that since commit b89e151054 ("Introduce logical
> > decoding.") tqual.h now emits this warning when compiled standalone:
>
> > /pgsql/source/HEAD/src/include/utils/tqual.h:101:13: warning: ‘struct HTAB’ declared inside parameter list [enabled by default]
> > /pgsql/source/HEAD/src/include/utils/tqual.h:101:13: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
>
> > The prototype in question is:
>
> > /*
> > * To avoid leaking to much knowledge about reorderbuffer implementation
> > * details this is implemented in reorderbuffer.c not tqual.c.
> > */
> > extern bool ResolveCminCmaxDuringDecoding(HTAB *tuplecid_data,
> > Snapshot snapshot,
> > HeapTuple htup,
> > Buffer buffer,
> > CommandId *cmin, CommandId *cmax);
>
> I guess the real question is why such a prototype is in tqual.h in
> the first place. ISTM this should be pushed somewhere specific to
> reorderbuffer.c. I'm -1 on having struct HTAB bleed into tqual.h
> via either of the methods you suggest.

It's the only logical decoding specific routine that's called by tqual.c
which doesn't need anything else from reorderbuffer. I'd like to avoid
more stuff bleeding in there...

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 2014-03-17 16:56:12 Re: warning when compiling utils/tqual.h
Previous Message Tom Lane 2014-03-17 16:50:37 Re: warning when compiling utils/tqual.h