[YAMos-dev] Re: diff for format warning on vbcc + inline problem

Hello Thore,

On Wed, 22 Nov 2006 06:45:25 +0100, Thore Böckelmann wrote:

[...]
>> It's the same issue as before. The diff also changes these to not be
>> inline. What is the real fix to allow these functions to be inlined on
>> vbcc ?
>
> Declare the functions as "static" instead of "INLINE". The definition
> of "INLINE" is different for gcc and vbcc.
>
> For gcc it's:
>
>     #define INLINE static __inline __attribute__((always_inline))
>
> And for vbcc it's:
>
>   #if (__STDC__ == 1L) && (__STDC_VERSION__ >= 199901L)
>     #define INLINE inline
>   #else
>     #define INLINE static
>   #endif
>
> As you can see it depends on the version of vbcc if "INLINE" really
> means "inline" or just "static", while it is always "static inline" (in
> terms of vbcc) with gcc. But one cannot use "static INLINE", because
> gcc will then complain about that double "static".
>
> Hence I changed the definitions of lngamma_asymp() and lnPQfactor() to
> be just static. That should not give such a huge speed penalty, I hope.
>
> Perhaps somebody with more compiler knowledge could take a deeper look
> at that.

As said, I still doesn't understand why VBCC doesn't allow to inline
functions with static member accesses. However, if that is true we should
better change the SDI_compiler.h definition of INLINE for VBCC to online
define "INLINE" as static and nothing else. So please revert your last
change and bring back all the INLINE definition for your functions and
change the SDI_compiler.h in the include path to define INLINE as static
only as that is what the uppercase "INLINE" is all about. It should be used
for generally inlining functions, but if VBCC doesn't allow to inline all
kind of functions then for VBCC it should be "static" only.

Removing all our "INLINE" definitions isn't really the best solution.

cheers,
jens
-- 
Jens Langner                                               Ph: +49-172-4452254
Rißweg 27b
01324 Dresden                                      Jens.Langner@xxxxxxxxxxxxxx
Germany                                            http://www.jens-langner.de/

Nothing is impossible for the man who doesn't have to do it himself.
-- Weiler's law

_______________________________________________________________________
YAM developer mailing list - http://www.freelists.org/list/yamos-dev
Listserver help...: mailto:yamos-dev-request@xxxxxxxxxxxxx?subject=HELP
Unsubscribe: mailto:yamos-dev-request@xxxxxxxxxxxxx?subject=UNSUBSCRIBE

Other related posts: