This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: kernel-2.2.1-undefined references.
- To: leei at ai dot sri dot com (Lee Iverson)
- Subject: Re: kernel-2.2.1-undefined references.
- From: Joe Buck <jbuck at Synopsys dot COM>
- Date: Mon, 8 Feb 99 17:40:44 PST
- Cc: jbuck at Synopsys dot COM, torvalds at transmeta dot com, ross dot s at ihug dot co dot nz, egcs at cygnus dot com, hpa at transmeta dot com
> > Remember, we are not talking about ISO C++ here. We are talking about
> > *C*, and specifically the GNU "extern inline" extension. So the M to R
> > is the gcc manual.
>
> I actually did, and while the discussion of "extern inline" strongly
> implies that it is guaranteed behavior, it doesn't *really* come out
> and say it. There is a hedge above though in the sentence "Note that
> certain usages in a function definition can make it unsuitable for
> inline substitution." It looks like that is just a hedge on automatic
> inlining, but it is really a hedge on the whole process...
Yes, clearly some functions cannot be inlined. The compiler developers
cannot promise the impossible.
The language implies that if inlining fails you'd just have an external
reference, meaning you'd have an undefined symbol if there is not a
second, non-inline definition.
> I do think that the language is ambiguous and definitely suggests
> something that the compiler cannot guarantee. That's why I've
> submitted a patch to egcs-patches to clarify this:
>
> http://egcs.cygnus.com/ml/egcs-patches/1999-02/msg00176.html
It might be appropriate to generate an error, not a warning, if
"extern inline" fails to inline, since it is clear from the documentation
that this is not a mere hint.