[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pcc-list
Subject:    Re: status of inline ?
From:       Anders Magnusson <ragge () ludd ! ltu ! se>
Date:       2007-09-26 16:37:04
Message-ID: 46FA8AB0.9020302 () ludd ! ltu ! se
[Download RAW message or body]

Hi Marc,

Marc Espie wrote:
> Tried to build some code which uses inline functions.
>
> Specifically, I have a function that's defined as inline in a header.
>
> It appears pcc is not able to inline it, and more annoyingly it's
> producing external linkage stuff from it.
>   
> If I annotate the function `static inline', this no longer happens.
>
> But unless I'm misinterpreting my C standard, I read in 6.7.4.6:
>
> `If *all* of the file scope declarations for a function in a translation
> unit include the inline function specifier without extern, then the
> definition in that translation unit is an inline definition. An inline
> definition *does not provide an external definition of the function*.
>   
There are a bunch of things regarding inline that are not as it should, one
of them is that it's not following the standard.  One of the reasons is that
it was quite complex do get it to compile stuff that were written for gcc
inline (and their handling of "extern").

I plan to fix inline in a not-so-far future.

-- Ragge

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic