C++ keywords in headers (was Re: [GENERAL] #include ) - Mailing list pgsql-hackers

From Tom Lane
Subject C++ keywords in headers (was Re: [GENERAL] #include )
Date
Msg-id 17797.1293384697@sss.pgh.pa.us
Whole thread Raw
Responses Re: C++ keywords in headers (was Re: [GENERAL] #include )  (Andrew Dunstan <andrew@dunslane.net>)
Re: C++ keywords in headers (was Re: [GENERAL] #include )  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Craig Ringer <craig@postnewspapers.com.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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Add foreign data wrapper error code values for SQL/MED.
Next
From: Hitoshi Harada
Date:
Subject: Re: knngist - 0.8