public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: extern inline
@ 2003-12-01 17:56 lrtaylor
  0 siblings, 0 replies; 2+ messages in thread
From: lrtaylor @ 2003-12-01 17:56 UTC (permalink / raw)
  To: y2bismil, gcc-help

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@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of y2bismil@engmail.uwaterloo.ca
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* extern inline
@ 2003-11-27 22:06 y2bismil
  0 siblings, 0 replies; 2+ messages in thread
From: y2bismil @ 2003-11-27 22:06 UTC (permalink / raw)
  To: GCC- help



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-01 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-01 17:56 extern inline lrtaylor
  -- strict thread matches above, loose matches on Subject: below --
2003-11-27 22:06 y2bismil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).