Re: Patch: Remove gcc dependency in definition of inline functions

Поиск
Список
Период
Сортировка
От Marko Kreen
Тема Re: Patch: Remove gcc dependency in definition of inline functions
Дата
Msg-id e51f66da0911292344k2d98d30dqf60dbf492c52eb48@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Patch: Remove gcc dependency in definition of inline functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Patch: Remove gcc dependency in definition of inline functions
Список pgsql-hackers
On 11/29/09, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Kurt Harriman <harriman@acm.org> writes:
>  > (Does anybody still use a C compiler that doesn't support
>  > inline functions?)

+1 for modern C.

> The question isn't so much that, it's whether the compiler supports
>  inline functions with the same behavior as gcc.  At minimum that
>  would require
>         * not generating extra copies of the function
>         * not whining about unreferenced static functions
>  How many compilers have you tested this patch against?  Which ones
>  does it actually offer any benefit for?

Those are not correctness problems.  Compilers with non-optimal or
missing 'inline' do belong together with compilers without working int64.
We may spend some effort to be able to compile on them, but they
should not affect our coding style.

'static inline' is superior to macros because of type-safety and
side-effects avoidance.  I'd suggest event removing any HAVE_INLINE
ifdefs and let autoconf undef the 'inline' if needed.  Less duplicated
code to maintain.  The existence of compilers in active use without
working 'inline' seems quite hypothetical these days.

-- 
marko


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

Предыдущее
От: rahimeh khodadadi
Дата:
Сообщение: Fwd: psql+krb5
Следующее
От: Jaime Casanova
Дата:
Сообщение: set the cost of an aggregate function