PS2SDK's printf: double->float ?
Posted: Sun Sep 12, 2004 12:25 am
After some IRC discussions, it came up that "doubles are evil for the PS2", and I think that nobody will really argue about that.
What is to argue now, is the fact that the xprintf.c code from ps2sdk internally and externally use doubles. The internal part could be changed quite quickly without too much side effect.
But the external part is the line va_arg(ap,double). Well, I have to admit I have quite no knowledge about how va_arg will work actually. I do think that it shouldn't cause any trouble, and since that it's a gcc's builtin, it should behave nicely. But I am a bit clueless, and I don't even know if my tests would be relevant.
So, before changing the doubles to float inside xprintf.c (or maybe, to be a little bit nicer, having a #define which will default to float, permitting people to change that using some CFLAGS's -D on the command line), I'd like to know if it would break things or not ? Again, I don't know if any of my tests are relevant, and I don't like the idea "let's change it, and wait for people's complains" :P
What is to argue now, is the fact that the xprintf.c code from ps2sdk internally and externally use doubles. The internal part could be changed quite quickly without too much side effect.
But the external part is the line va_arg(ap,double). Well, I have to admit I have quite no knowledge about how va_arg will work actually. I do think that it shouldn't cause any trouble, and since that it's a gcc's builtin, it should behave nicely. But I am a bit clueless, and I don't even know if my tests would be relevant.
So, before changing the doubles to float inside xprintf.c (or maybe, to be a little bit nicer, having a #define which will default to float, permitting people to change that using some CFLAGS's -D on the command line), I'd like to know if it would break things or not ? Again, I don't know if any of my tests are relevant, and I don't like the idea "let's change it, and wait for people's complains" :P