This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
bug: returning a float doesn't work
- To: gcc-bugs at gcc dot gnu dot org
- Subject: bug: returning a float doesn't work
- From: "Juan Carlos Pizarro Méndez" <jcpizarro1977 at mixmail dot com>
- Date: Wed, 09 May 2001 18:22:52 +100
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