delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/30/07:30:05

Date: Mon, 30 Nov 1998 14:29:35 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Manni Heumann <manni AT hotbot DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: string class
In-Reply-To: <36627dc3.0@news.uni-bielefeld.de>
Message-ID: <Pine.SUN.3.91.981130141908.10687C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Mon, 30 Nov 1998, Manni Heumann wrote:

> Running the compiler without the commandline switches necessary for inlining, 
> the compiler, of course, will not do the inlining.
> 
> What now?

If I understand the situation correctly, there should be another copy of 
the same functions in the library.  (At least this is how things are 
required to work in C, I'm not sure about C++.)  This way, if you compile 
with -O, you get the inlined version; if not, you get the non-inlined 
version from the library.

> In any case the functions should have been compiled. And, inlined or 
> not, they should be available in the file where I included the header.
> Then why doesn't the linker see them right there?

Because the compiler didn't compile them into any code.  Inline functions 
are like macros: they get spliced into every place that uses them, and 
otherwise disappear from existence.  But if some other class called by 
your program (whose source wasn't submitted to the compiler) needs to 
call some String function, the linker cannot resolve that call.

I guess -fkeep-inline-functions option might be an alternative to
compiling with -O. 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019