Article View: gnu.gcc.bug
Article #797inlining bug...
From: Jeff Lewis
Date: Thu, 16 Nov 1989 18:50
Date: Thu, 16 Nov 1989 18:50
31 lines
928 bytes
928 bytes
Machine: Sun4os4
Gcc: 1.36
In the following program, the 'inline' declaration appears to cause the
type of the function to become lost. The second printf()'s output is
bogus because dosqrt2()'s return value is interpreted as 'int'.
#include <math.h>
static double
dosqrt1(r)
double r;
{
return sqrt(r);
}
static inline double
dosqrt2(r)
double r;
{
return sqrt(r);
}
main()
{
printf("%g\n", dosqrt1(2.0));
printf("%g\n", dosqrt2(2.0));
}
Technical Details
Message-ID:
<8911161850.AA10976@rvl3.ecn.purdue.edu>Path:
arc1-ca.pugleaf.net!utzoo!yunexus!ists!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!rvl3.ecn.purdue.edu!lewieShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!yunexus!ists!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!rvl3.ecn.purdue.edu!lewie From: lewie@rvl3.ecn.purdue.edu (Jeff Lewis) Newsgroups: gnu.gcc.bug Subject: inlining bug... Message-ID: <8911161850.AA10976@rvl3.ecn.purdue.edu> Date: 16 Nov 89 18:50:18 GMT Article-I.D.: rvl3.8911161850.AA10976 Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 31