Article View: gnu.gcc.bug
Article #1103(none)
From: DEA
Date: Wed, 09 Sep 1992 18:11
Date: Wed, 09 Sep 1992 18:11
60 lines
1560 bytes
1560 bytes
Bugs in GCC 2.2
I used GCC version 2.2 (for my own use only) for several
months, and discovered a problem when passing parameters
notably float parameters. Just look at the two following
small programs, they seems to be similiar, compile them,
run them, compare their result and drop me a line if I'm
wrong.
/* file f1.c */
void print_args(float, float, float);
main()
{
print_args(1.0, 67.89, 3.141592654);
}
/* end of file f1.c */
/*file f2.c */
#ifdef NORM
void print_args(float a, float b, float c)
{
printf("a = %f b = %f c = %f\n", (double)a, (double)b, (double)c);
}
#else
void print_args(a, b, c)
float a, b, c;
{
printf("a = %f b = %f c = %f\n", (double)a, (double)b, (double)c);
}
#endif
/* end of file f2.c */
/*********** Now these are the two programs *******/
program 1: gcc -o prog1 f1.c f2.c
program 2: gcc -o prog2 -DNORM f1.c f2.c
Now run prog1 as result I've got "a = 0.007813 b = 50.123871 c = 0.000000"
but not "a = 1.0 b = 67.89 c = 3.141592654" expected.
prog2 give me the correct result.
Please give me answer if you can understand this.
Friendly,
FRANCOURT Daniel
francour@ia3.u-strasbg.fr
Technical Details
Message-ID:
<9209091411.AA00522@ia3>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ia3.u-strasbg.fr!francourShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ia3.u-strasbg.fr!francour From: francour@ia3.u-strasbg.fr (DEA) Subject: (none) Message-ID: <9209091411.AA00522@ia3> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Wed, 9 Sep 1992 18:11:38 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 61