Re: Mostly Harmless: Welcoming our C++ friends

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Mostly Harmless: Welcoming our C++ friends
Дата
Msg-id 9199.1229370650@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Mostly Harmless: Welcoming our C++ friends  (Kurt Harriman <harriman@acm.org>)
Ответы Re: Mostly Harmless: Welcoming our C++ friends  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Список pgsql-hackers
[ just realized that I set this message aside to reply to later, and then forgot about it --- apologies ]

Kurt Harriman <harriman@acm.org> writes:
> Tom Lane wrote:
>> There is no such option, and won't be.

> Yours is the first comment anyone has posted to the list
> regarding my proposed c++configure patch, and it sounds
> alarmingly definite.
> May I ask you to elaborate?  Have you more to say on the
> subject?

Well, as I understand it the proposal is to build main.c as C++ in the
hope of (1) identifying C++ incompatibilities in our include headers,
and (2) linking C++ instead of C library on platforms where they are
different.

As for #1, main.c doesn't (and shouldn't) include a large fraction of
the headers that might be interesting to a C++ add-on --- I'm surprised
that it hits as many as it does, because it surely has no direct use
for most of them.

> Extra #includes could be added to main.c just for the purpose of
> getting them C++-syntax-checked.

They'd disappear again the next time Bruce runs his unnecessary-#include
elimination script.  And anyway the vast majority of the inclusions you
show here are accidental, indirect inclusions that might go away in any
header refactoring.


As for #2, thanks but no thanks: the very last thing I want is to have a
switch that causes us to start running on a different basic C library.
That would open all sorts of portability and testability concerns.
AFAIK there are only a few obsolete platforms where a C++-specific libc
is needed, and I'm perfectly happy to blow off the idea of supporting
C++ add-ons on them.


So I'm willing to support a project of making *all* our headers (or at
least all the ones a C++ addon could possibly care about) C++-safe,
if there's buildfarm support for making sure they stay that way.  But
I don't approve of changing the way main.c gets compiled.

I am, btw, still waiting for an actually plausible use-case for this.
AFAICS the setjmp-vs-exceptions thing puts a very serious crimp in
what you could hope to accomplish by importing a pile of C++ code.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: planner issue with constraint exclusion
Следующее
От: Martin Pihlak
Дата:
Сообщение: Re: SQL/MED compatible connection manager