Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: C++ question (OT)

Author: José Carlos

Date: 05:51:57 01/19/01

Go up one level in this thread


On January 19, 2001 at 04:36:32, Severi Salminen wrote:

>
>>>Would there be any downside to the inline function?
>>
>>Some compilers might decide to treat it as a normal function instead of inlining
>>it, in some cases. I think Borland does this if the inline function contains
>>loops or other things it considers "too complex".
>
>In VC++ 6.0 you can specify __forceinline and compiler _will_ make it an inline
>function. Very useful. There might be this option in Borland as well - which one
>are you using?
>
>Severi

  I'm afraid this does not always happen. I did this in my program some time ago
and, when building with warning level 4 (all warnings) the compiler said, for a
bunch of functions, that he could not inline them. The warning didn't explain
why. I was trying several changes in order to make the thing inline my
functions, but failed after all. I had to resign and say "ok, I'm not able to do
it" :(
  But, after making my source code freely available, Dann made a change and...
the functions were inlined. He creates a .c file with includes for all files in
my original project, and then he compiles it.
  I must admit that I don't understand why this works, and not doing it doesn't.
Maybe someone can explain it here...? Dann?

  José C.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.