Re: pgsql: Add configure infrastructure to detect support for C99's restric

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add configure infrastructure to detect support for C99's restric
Date: 2017-10-12 18:03:34
Message-ID: 20171012180334.i2stb7ubuiihdu22@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Hi,

On 2017-10-12 13:55:07 -0400, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On 2017-10-12 11:30:00 -0400, Tom Lane wrote:
> >> 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.
>
> It's 2017 and they're still not C99 compliant? Oh well.

...

> TBH, I really doubt that restrict buys us enough performance to justify
> dealing with this. I'd just revert that change altogether.

It's quite noticeable, and there's plenty of other case where it seems
likely to be beneficial.

> Or, if you insist on having it, we're going to have to go the pg_restrict
> route. I don't see why that means duplicating any configure logic: on
> non-Windows we can use the autoconf probe and then write
> "#define pg_restrict restrict".

Yea, that should work. I'll try to come up with a patch.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2017-10-12 19:18:37 pgsql: Synchronize error messages.
Previous Message Tom Lane 2017-10-12 17:55:07 Re: pgsql: Add configure infrastructure to detect support for C99's restric

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-10-12 18:59:31 Re: Parallel Append implementation
Previous Message Tom Lane 2017-10-12 17:55:07 Re: pgsql: Add configure infrastructure to detect support for C99's restric