> Date: Tue, 5 Apr 2011 09:44:21 +0200
> From: Pascal Stumpf <[email protected]>
> 
> On Mon, Apr 04, 2011 at 11:18:26AM -0700, Philip Guenther wrote:
> > On Mon, Apr 4, 2011 at 11:06 AM, Pascal Stumpf <[email protected]> 
> > wrote:
> > > pcc currently only chokes on some inline functions that need external
> > > linkage. gcc isn't pesky about that, but pcc and clang are (rightfully,
> > > imo).
> > 
> > It's completely legal and defined (by the standard and not just gcc!)
> > for a function to be inline in the file where it's defined and have
> > external linkage.  That just means "inline if you can in this file,
> > but still provide a copy callable from other files". 
> Not if it's never declared as extern, according to the standard. In that
> case it's an "inline definition", as they call it.

No that's not what the standard says.  The standard says that
something is an "inline definition" if *all* declarations of a
functions have "inline" on them.  That clearly isn't the case here.
The standard also says that a function declaration with no
starage-class specifier on it has external linkage.  So while there is
a (minor) ambuguity in the spec here, the logical conclusion would be
that C99 should behave as we expect and that clang (according to you,
but not according to jsg@) and pcc have a bug.

As long as we're stuck with gcc2 and gcc3 for some of our
architectures, working around those bugs in clang and pcc is not an
option.

Reply via email to