Re: Patch: Remove gcc dependency in definition of inline functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Patch: Remove gcc dependency in definition of inline functions
Date
Msg-id 3171.1260975053@sss.pgh.pa.us
Whole thread Raw
In response to Re: Patch: Remove gcc dependency in definition of inline functions  (Marko Kreen <markokr@gmail.com>)
Responses Re: Patch: Remove gcc dependency in definition of inline functions
List pgsql-hackers
Marko Kreen <markokr@gmail.com> writes:
> On 12/16/09, Kurt Harriman <harriman@acm.org> wrote:
>> For gcc, I think the __attribute__ has to come after the function's
>> parameter list, rather than before the return type.

> No.

[ squint... ]  That's nowhere documented that I can find: all the
examples in the gcc docs show __attribute__ after the parameters.
It does seem to work, but should we rely on it?

The bigger problem though is that not all versions of gcc understand
always_inline:

$ gcc -Wall check.c
check.c:3: warning: `always_inline' attribute directive ignored

which I think is sufficient reason to put an end to this sub-thread.
We have no particular need for force-inline semantics anyway, as
long as the compiler behaves reasonably for unreferenced inlines,
which gcc always has.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: idea - new aggregates median, listagg
Next
From: Tom Lane
Date:
Subject: Re: Range types