RE: extern inline

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

 



Unless I'm mistaken, I believe that the definitions to inline functions
need to be available to the compilation unit where they are being used.
I believe this is specified as part of the ANSI C++ standard (although
some compilers have extensions that allow what you are trying to do).
This means that you either need to put the definition in the header
file, or include the file that has the definition either into the
include file or the source file where you are using the function.

Cheers,
Lyle

-----Original Message-----
From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx] On
Behalf Of y2bismil@xxxxxxxxxxxxxxxxxxxx
Sent: Thursday, November 27, 2003 3:07 PM
To: GCC- help
Subject: extern inline



Hi all,

I was wondering about extern inline.  Can this really do inlining when
the
implementation exists in another object file?

Like if I declare a function inline in a.h with attribute always_inline
I then use the function in b.cpp
But I implement it in c.cpp

I have hard time thinking this is truly possible, but maybe it is.  I
suspect,
in b.cpp, the inlining will fail and it will resort to a regular call in
object
file for c.cpp correct?

Yamin

----------------------------------------
This mail sent through www.mywaterloo.ca


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux