C++ keywords in headers (was Re: [GENERAL] #include <funcapi.h>)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: Elliot Chance <elliotchance(at)gmail(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: C++ keywords in headers (was Re: [GENERAL] #include <funcapi.h>)
Date: 2010-12-26 17:31:37
Message-ID: 17797.1293384697@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Craig Ringer <craig(at)postnewspapers(dot)com(dot)au> writes:
> On 12/26/2010 02:14 PM, Elliot Chance wrote:
>> /usr/include/pgsql/server/nodes/primnodes.h:1155: error: expected unqualified-id before using

> You've neglected to mention which version of Pg you're compiling
> against, so that line number means nothing. What's the offending line of
> code and the surrounding few lines in primnodes.h?

I'm betting 8.4, because there is a field named "using" on that line in
8.4 ...

> In any case, I think it's very likely the issue is a C/C++
> incompatibility in the Pg headers. It fails for me in a different place
> using Pg 9.1git and g++ 4.5, complaining about the use of "private" as
> an identifier in fmgr.h, because it's a keyword in C++.

We did clean up C++ keyword uses in the header files in 9.0, but your
report shows it's already gotten broken again. I'm disinclined to fix
it unless someone steps up to create an automated test that will get run
reasonably often. We had that discussion when the patch to rename
keyword-named fields was proposed, and nothing got done, and the current
state of affairs is the entirely predictable result.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Radosław Smogura 2010-12-26 18:42:51 Binary procedures for few types
Previous Message Scott Marlowe 2010-12-26 15:00:19 Re: why update is slower on my pc?

Browse pgsql-hackers by date

  From Date Subject
Next Message Hitoshi Harada 2010-12-26 18:19:07 Re: knngist - 0.8
Previous Message Tom Lane 2010-12-26 17:17:41 Re: Re: [COMMITTERS] pgsql: Add foreign data wrapper error code values for SQL/MED.