bug: returning a float doesn't work

Juan Carlos Pizarro Méndez jcpizarro1977@mixmail.com
Wed May 9 10:23:00 GMT 2001


hi, i'm }xD

float f(float x) {  /* this function doesn't 
work */
  return ((x * x) / 2.0);
} /* float is impossible into %eax% until now 
*/

void g(float *y,float x) { /* it does work */
  *y = ((x * x) / 2.0);
}

main() {
  float y = 0.0;
  y = f(3.0);
  printf("%f\n",y); /* fail */
  g(&y,3.0);
  printf("%f\n",y); /* ok */
}

and gcc doesn't warn this error

Tu correo gratis en MixMail http://www.mixmail.com
Juega y gana medio kilo en http://finanzas.com/game



More information about the Gcc-bugs mailing list