Re: pgsql: Add configure infrastructure to detect support for C99's restric
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-committers@postgresql.org
Date: 2017-10-12T18:03:34Z
Lists: pgsql-hackers
Hi, On 2017-10-12 13:55:07 -0400, Tom Lane wrote: > Andres Freund <andres@anarazel.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
Commits
-
Use C99 restrict via pg_restrict, rather than restrict directly.
- 91d5f1a4a3e8 11.0 landed
-
Work around overly strict restrict checks by MSVC.
- 060b069984a6 11.0 landed
-
Add configure infrastructure to detect support for C99's restrict.
- 0b974dba2d6b 11.0 cited