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

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add configure infrastructure to detect support for C99's restric
Date: 2017-10-12 00:13:20
Message-ID: 20171012001320.4putagiruuehtvb6@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Hi,

On 2017-10-11 23:11:15 +0000, Andres Freund wrote:
> Add configure infrastructure to detect support for C99's restrict.
>
> Will be used in later commits improving performance for a few key
> routines where information about aliasing allows for significantly
> better code generation.
>
> This allows to use the C99 'restrict' keyword without breaking C89, or
> for that matter C++, compilers. If not supported it's defined to be
> empty.

Woodlouse doesn't like this, erroring out with:
C:\buildfarm\buildenv\HEAD\pgsql.build\src\include\libpq/pqformat.h(47): error C2219: syntax error : type qualifier must be after '*' (src/backend/access/common/printsimple.c) [C:\buildfarm\buildenv\HEAD\pgsql.build\postgres.vcxproj]

It's MSVC being super peculiar about error checks. I think msvc is just
confused by the pointer hiding typedef. Using some online MSVC (and
other compilers) frontend:
https://godbolt.org/g/TD3nmA

I confirmed that removing the pointer hiding typedef indeed resolves the
isssue.

I can't quite decide whether msvc just has taste and dislikes pointer
hiding typedefs as much as I do, or whether it's incredibly stupid ;)

I'll add a comment and use StringInfoData *.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-10-12 00:28:21 pgsql: Improve performance of SendRowDescriptionMessage.
Previous Message Robert Haas 2017-10-12 00:04:55 pgsql: pg_stat_statements: Widen query IDs from 32 bits to 64 bits.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-10-12 00:28:21 pgsql: Improve performance of SendRowDescriptionMessage.
Previous Message Robert Haas 2017-10-12 00:05:25 Re: 64-bit queryId?