Re: SPI-header-files safe for C++-compiler

From: "Jacob Rief" <jacob(dot)rief(at)gmx(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, neilc(at)samurai(dot)com
Cc: pgsql-patches(at)postgresql(dot)org, andrew(at)dunslane(dot)net
Subject: Re: SPI-header-files safe for C++-compiler
Date: 2007-06-29 09:34:59
Message-ID: 20070629093459.38870@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Thu, 2007-28-06 at 01:15 -0400, Tom Lane wrote:
> Sure, but we don't break them just on a whim. The bottom line here is
> whether we are going to make a real commitment to making C++ usable as
> a backend extension language --- and for the reasons I mentioned, that
> would entail a lot more than renaming a few identifiers. It was already
> pointed out upthread that wrapping the inclusions in extern "C" {...}
> would fix the identifier part of the problem from the user side, so I do

No, wrong. Adding extern "C" does not fix the C++-keywords as identifiers
problem. Adding extern "C" only tells the compiler to switch off
name-mangling. A C++-compiler does not allow any kind of plain-old C in
such blocks. With some drawbacks, it is even perfectly legal to use some
C++ features inside an extern "C" block.

> not see the point of fixing it from our side unless we are prepared to
> buy into a lot of other changes. A C++ writer who is unwilling to add
> the extern{} bit around inclusions of C headers seems unlikely to "work
> with us" as regards to error-throwing conventions, for instance.

I would have never posted any patch, if just adding extern "C" { } would
have solved my problems, but as mentioned above, it doesn't.

Jacob

--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Marko Kreen 2007-06-29 10:02:26 Re: SPI-header-files safe for C++-compiler
Previous Message Heikki Linnakangas 2007-06-29 08:25:12 Re: [PATCHES] Doc update for pg_start_backup