Re: [PATCH 04/16] Add embedded list interface (header only)

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: [PATCH 04/16] Add embedded list interface (header only)
Дата
Msg-id CAEYLb_VEO-=Km1C8dSkHhvfB-Q5Sap7enhV2gHt=20Yao2MNZw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH 04/16] Add embedded list interface (header only)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 25 June 2012 20:59, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
>> Also, 'static inline' *is* C99 conforming as far as I can see?
>
> Hmm.  I went back and re-read the C99 spec, and it looks like most of
> the headaches we had in the past with C99 inline are specific to the
> case where you want an extern declaration to be available.  For a
> function that exists *only* as a static it might be all right.  So maybe
> I'm misremembering how well this would work.  We'd have to be sure we
> don't need any extern declarations, though.

Yeah, the extern inline functions sounds at least superficially
similar to what happened with extern templates in C++ - exactly one
compiler vendor implemented them to the letter of the standard (they
remained completely unimplemented elsewhere), and subsequently went
bust, before they were eventually removed from the standard last year.

Note that when you build Postgres with Clang, it's implicitly and
automatically building C code as C99. There is an excellent analysis
of the situation here, under "C99 inline functions":

http://clang.llvm.org/compatibility.html

> Having said that, I'm still of the opinion that it's not so hard to deal
> with that we should just blow off compilers where "inline" doesn't work
> well.

Fair enough.

--
Peter Geoghegan       http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training and Services


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: new --maintenance-db options
Следующее
От: "ktm@rice.edu"
Дата:
Сообщение: Re: libpq compression