emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: External inline functions


From: Óscar Fuentes
Subject: Re: External inline functions
Date: Sun, 06 Nov 2011 21:39:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Andreas Schwab <address@hidden> writes:

> Eli Zaretskii <address@hidden> writes:
>
>> Is this portable enough?  The Microsoft compiler errors out during
>> linking due to unresolved externals, but is this a problem specific to
>> that compiler?
>
> Apparently this is not a C compiler.  The inline specifier does not
> influence the linkage.

There are several issues here. First, `inline' was introduced in the
1999 standard. There is no mention to it in the 1990 standard. So, if
the Microsoft compiler defaults to the 1990 standard it must be
implementing `inline' in a vendor-dependent way.

Second, my reading of the 1999 standard says that `inline' *does* affect
linkage:

6.7.4 p6:

... 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 for the
function, and does not forbid an external definition in another
translation unit. ...

but OTOH xdisp.c includes dispextern.h, which declares the
function. Decorating the declaration of window_box_right with `extern'
should work.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]