🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by DEA Wed, 09 Sep 1992 18:11
(none)
#1103
Author: DEA
Date: Wed, 09 Sep 1992 18:11
60 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads