pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Joe Conway <mail@joeconway.com>
Cc: Mike Palmiotto <mike.palmiotto@crunchydata.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: partitioned tables and contrib/sepgsql
Date: Wed, 05 Apr 2017 12:14:05 -0400
Message-ID: <20067.1491408845@sss.pgh.pa.us> (raw)
In-Reply-To: <2a3b192d-3e52-5611-0fa3-a1e62c7be7c1@2ndquadrant.com>
References: <20170309144718.GE9812@tamriel.snowman.net>
	<CAMN686GVuHxwbJWZFhXaecPoGAH5nZu-UsPA4XszaJj+BuANVA@mail.gmail.com>
	<CA+TgmobTJnasxpRkJxGcHaz85LyqdXBKZRxP6pCCS-UkhcHUBQ@mail.gmail.com>
	<CAMN686H7PLEguRE4ndFG47q2CLwQkafBWOkjY5o9CULkDQ19Zw@mail.gmail.com>
	<CAMN686HcT+Sc37rP6eyyfV-GU13p=XLL=R3zXzxbuwwXEj0V5g@mail.gmail.com>
	<CA+TgmoY+zN3zq1PuYwXOXpehMJR=wtZes2q=2qpDi4SLwkMa9Q@mail.gmail.com>
	<81ddcddc-b9f6-9d80-19c4-c9270fc71fd5@joeconway.com>
	<CA+TgmoathxbFZyi1EphhRyLFKjHbTVDj-qT77FdkX9Vy1p_2Nw@mail.gmail.com>
	<c188488f-b35c-25f0-4aac-08eff7a8c84a@joeconway.com>
	<CAMN686E1x8wF7bASsh_9cB9+sG5vpWFxfnTwO8PskAPs-yaTmg@mail.gmail.com>
	<426dde50-a6ef-d53c-0607-c0766afd6698@joeconway.com>
	<3b0f0a27-0ccf-7298-5365-87d685eeea42@joeconway.com>
	<CA+TgmoaKeXAChH8qgEAF03ejjMz5e_sDA91xr2UGmJXH8EH=RA@mail.gmail.com>
	<19352.1491368287@sss.pgh.pa.us>
	<66233275-7be2-f34f-900a-aa4a5a93afe5@2ndquadrant.com>
	<20411.1491369620@sss.pgh.pa.us>
	<2a3b192d-3e52-5611-0fa3-a1e62c7be7c1@2ndquadran! t.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> On 4/5/17 01:20, Tom Lane wrote:
>> $ cat test.c
>> typedef char bool;
>> typedef char bool;
>> $ gcc -c test.c
>> test.c:2: error: redefinition of typedef 'bool'
>> test.c:1: note: previous declaration of 'bool' was here

> But the above is not how the current code looks.

No, but it is what the proposed 0001a patch would result in.

The experiments I just did prove that F25's gcc is cheating like mad in
its implementation of "#include <stdbool.h>".  I suspect that it's somehow
turning off the warning that you ought to get about redefining typedef
bool, as well, though I'm very unclear on how.  In any case we don't need
the extra typedef and should leave it out.

> So if you get stdbool.h first, then c.h does nothing.  If you get c.h
> first, then the macro from stdbool.h will mask the c.h typedef.

Right, and *either* of those is disastrous if sizeof(_Bool) isn't 1.

> Where this gets really fun is when you include other header files
> between, say, postgres.h and selinux/label.h, because then the function
> definitions from those header files will be incompatible before and
> after the stdbool.h inclusion.  Which indeed currently leads to the
> following compilation error:

The compilation complaint comes from the fact that we have

static bool
sepgsql_needs_fmgr_hook(Oid functionId)

appearing after the inclusion of <stdbool.h>, causing it to mean
something else than what a Postgres programmer would expect.
The other headers aren't at issue really.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (61+ messages)  latest in thread

Message-ID: <20067.1491408845@sss.pgh.pa.us>
Permalink:  ../20067.1491408845@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20067.1491408845@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, robertmhaas@gmail.com, mail@joeconway.com, mike.palmiotto@crunchydata.com, sfrost@snowman.net
  Subject: Re: partitioned tables and contrib/sepgsql
  In-Reply-To: <20067.1491408845@sss.pgh.pa.us>
  References: <20170309144718.GE9812@tamriel.snowman.net> <CAMN686GVuHxwbJWZFhXaecPoGAH5nZu-UsPA4XszaJj+BuANVA@mail.gmail.com> <CA+TgmobTJnasxpRkJxGcHaz85LyqdXBKZRxP6pCCS-UkhcHUBQ@mail.gmail.com> <CAMN686H7PLEguRE4ndFG47q2CLwQkafBWOkjY5o9CULkDQ19Zw@mail.gmail.com> <CAMN686HcT+Sc37rP6eyyfV-GU13p=XLL=R3zXzxbuwwXEj0V5g@mail.gmail.com> <CA+TgmoY+zN3zq1PuYwXOXpehMJR=wtZes2q=2qpDi4SLwkMa9Q@mail.gmail.com> <81ddcddc-b9f6-9d80-19c4-c9270fc71fd5@joeconway.com> <CA+TgmoathxbFZyi1EphhRyLFKjHbTVDj-qT77FdkX9Vy1p_2Nw@mail.gmail.com> <c188488f-b35c-25f0-4aac-08eff7a8c84a@joeconway.com> <CAMN686E1x8wF7bASsh_9cB9+sG5vpWFxfnTwO8PskAPs-yaTmg@mail.gmail.com> <426dde50-a6ef-d53c-0607-c0766afd6698@joeconway.com> <3b0f0a27-0ccf-7298-5365-87d685eeea42@joeconway.com> <CA+TgmoaKeXAChH8qgEAF03ejjMz5e_sDA91xr2UGmJXH8EH=RA@mail.gmail.com> <19352.1491368287@sss.pgh.pa.us> <66233275-7be2-f34f-900a-aa4a5a93afe5@2ndquadrant.com> <20411.1491369620@sss.pgh.pa.us> <20067.1491408845@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox