From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Add configure infrastructure to detect support for C99's restric
Date: Thu, 12 Oct 2017 10:45:44 -0700
Message-ID: <20171012174544.53kwdeyrt4id7hgg@alap3.anarazel.de> (raw)
In-Reply-To: <2097.1507822200@sss.pgh.pa.us>
References: <E1e2Q9j-000183-L0@gemulon.postgresql.org>
<20171012001320.4putagiruuehtvb6@alap3.anarazel.de>
<20171012045953.khz4bjdrar5mzrm7@alap3.anarazel.de>
<2097.1507822200@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
On 2017-10-12 11:30:00 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > I've temporarily silenced that error by moving the stdlib.h include
> > before the definition of restrict, but that seems fairly fragile. I
> > primarily wanted to see whether there's other problems. At least thrips
> > is is now happy.
>
> > I see a number of options to continue:
> > - only define restrict on msvc 2013+ - for some reason woodlouse didn't
> > complain about this problem, but I'm very doubtful that that's
> > actually reliable.
> > - rename restrict to pg_restrict. That's annoying because we'd have to
> > copy the autoconf test.
> > - live with the hack of including stdlib.h early, in pg_config.h.win32.
> > - $better_idea
>
> I don't actually see why you need a #define at all --- "restrict" is the
> standard spelling of the keyword no?
It is, but a lot of compilers name it differently, e.g. __restrict in
the case of msvc.
> I really do not like the stdlib.h hack: that amounts to assuming that
> only stdlib.h does or ever will contain declspec(restrict). Maybe
> you could get away with that if you were applying it only to long-dead
> MSVC versions, but doing it "#if (_MSC_VER >= 1500)" is clearly going
> to break someday.
Yea, I dislike it quite a bit too. Unfortunately not even defining
restrict to empty as if it were unsupported looks viable to me :(
Greetings,
Andres Freund
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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-committers@postgresql.org
Cc: andres@anarazel.de, tgl@sss.pgh.pa.us
Subject: Re: pgsql: Add configure infrastructure to detect support for C99's restric
In-Reply-To: <20171012174544.53kwdeyrt4id7hgg@alap3.anarazel.de>
References: <E1e2Q9j-000183-L0@gemulon.postgresql.org> <20171012001320.4putagiruuehtvb6@alap3.anarazel.de> <20171012045953.khz4bjdrar5mzrm7@alap3.anarazel.de> <2097.1507822200@sss.pgh.pa.us> <20171012174544.53kwdeyrt4id7hgg@alap3.anarazel.de>
* 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