🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #41734

Inlining doesn't evaluate constant expressions for floating point operands

#41734
From: "M Day SN Systems So"
Date: Wed, 21 Feb 1996 00:00
32 lines
885 bytes
Why does

inline int muli (int i, int j)
{
    return i * j;
}

...

   i = muli(4, 3);
   

basically result in code which just assigns 12 to i but

inline double muld (double i, double j)
{
    return i * j;
}

...

   i = muld(4.0, 3.0);


call the floating point library with the two constant operands 3.0 and 
4.0 and assign the result to i ?

Does anyone know a way to fix this ?

Thanks

Martin
Technical Details
Message-ID: <Dn5F94.DGx@cix.compulink.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,b13aaa66172fe60b,start
X-Google-Attributes: gid11318c,public
From: tal@cix.compulink.co.uk ("M Day SN Systems So")
Subject: Inlining doesn't evaluate constant expressions for floating point operands
Date: 1996/02/21
Message-ID: <Dn5F94.DGx@cix.compulink.co.uk>
X-Deja-AN: 140487422
organization: SN Systems Ltd                
x-news-software: Ameol
newsgroups: gnu.gcc.help