This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bug: returning a float doesn't work


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]