Re: warning when compiling utils/tqual.h - Mailing list pgsql-hackers

From Tom Lane
Subject Re: warning when compiling utils/tqual.h
Date
Msg-id 22288.1395075037@sss.pgh.pa.us
Whole thread Raw
In response to warning when compiling utils/tqual.h  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: warning when compiling utils/tqual.h
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.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
bydefault]
 
> /pgsql/source/HEAD/src/include/utils/tqual.h:101:13: warning: its scope is only this definition or declaration, which
isprobably 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.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: warning when compiling utils/tqual.h
Next
From: Andres Freund
Date:
Subject: Re: warning when compiling utils/tqual.h