From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Marko Kreen <markokr(at)gmail(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kurt Harriman <harriman(at)acm(dot)org>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Patch: Remove gcc dependency in definition of inline functions |
Date: | 2009-11-30 12:06:18 |
Message-ID: | 200911301206.nAUC6IX28849@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Marko Kreen wrote:
> On 11/29/09, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Kurt Harriman <harriman(at)acm(dot)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.
I thought one problem was that inline is a suggestion that the compiler
can ignore, while macros have to be implemented as specified.
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
From | Date | Subject | |
---|---|---|---|
Next Message | Thom Brown | 2009-11-30 12:29:57 | Feature request: permissions change history for auditing |
Previous Message | Robert Haas | 2009-11-30 11:23:57 | Re: draft RFC: concept for partial, wal-based replication |