pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe Conway <mail@joeconway.com>
Cc: Robert Haas <robertmhaas@gmail.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:04:00 -0400
Message-ID: <19727.1491408240@sss.pgh.pa.us> (raw)
In-Reply-To: <6d700f91-6bcb-9092-c897-501c7228975f@joeconway.com>
References: <20170309144718.GE9812@tamriel.snowman.net>
	<CA+TgmoaXWqH_7oDc+=0C72F45nOyTXcpnkAR-W_2NWE395VnLQ@mail.gmail.com>
	<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>
	<6d700f91-6bcb-9092-c897-501c7228975f@joeconway.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Joe Conway <mail@joeconway.com> writes:
> On 04/04/2017 09:58 PM, Tom Lane wrote:
>> Another issue is whether you won't get compiler complaints about
>> redefinition of the "true" and "false" macros.  But those would
>> likely only be warnings, not flat-out errors.

> I have not been able to generate warnings or errors around "true" and
> "false".

Interesting.  Poking at it on a Fedora 25 machine, I also see a
bool-type-related warning in sepgsql/label.c, but nothing around macro
redefinitions.  In particular, I find that

#include "postgres.h"

#include <stdbool.h>

is completely silent.  On the other hand,

#include "postgres.h"

#define bool    _Bool
#define true    1
#define false   0

generates the warnings I expected about "true" and "false" being
redefined.  Which is damn odd, because I copied-and-pasted those
lines out of
/usr/lib/gcc/x86_64-redhat-linux/6.3.1/include/stdbool.h

Conclusion: Fedora's gcc is playing fast and loose somehow with the
command "#include <stdbool.h>"; that does not include the file
you'd think it does, it does something magic inside the compiler.
The magic evidently includes not complaining about duplicate macro
definitions for true and false.

Anyway, I'd recommend that we do something like

 #include <selinux/label.h>
+
+/*
+ * <selinux/label.h> includes <stdbool.h>, which creates an incompatible
+ * #define for bool.  Get rid of that so we can use our own typedef.
+ * (For obscure reasons, the "true" and "false" macros don't cause issues.)
+ */
+ #undef bool

and call it good.

			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: <19727.1491408240@sss.pgh.pa.us>
Permalink:  ../19727.1491408240@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19727.1491408240@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, mail@joeconway.com, robertmhaas@gmail.com, mike.palmiotto@crunchydata.com, sfrost@snowman.net
  Subject: Re: partitioned tables and contrib/sepgsql
  In-Reply-To: <19727.1491408240@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> <6d700f91-6bcb-9092-c897-501c7228975f@joeconway.com> <19727.1491408240@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