This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix hpux10 string to real conversion defficiences
- From: FX Coudert <fxcoudert at gmail dot com>
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org, burnus at net-b dot de
- Date: Fri, 11 Apr 2008 15:09:42 +0100
- Subject: Re: [PATCH] Fix hpux10 string to real conversion defficiences
- References: <20080411135608.D82944E39@hiauly1.hia.nrc.ca>
I don't believe the code is dead. It is used for all conversions
except
"nan", "inf" and "infinity".
Of course. I apologise, I read too fast.
I'll make the other changes. I thought __attribute__((unused)) had
to appear on a function's declaration, but I'll recheck.
Indeed, that would be a very good reason to have a forward declaration.
It is my understanding that that leading whitespace has been stripped
already.
I think so, because otherwise, we would already have trouble across
platforms in these cases, but I think Jerry, who knows this code very
well, could enlighten us with a definite answer.
The optional stuff is not supported on hpux11, and it is
implementation
dependent on linux.
#include <stdlib.h>
#include <stdio.h>
int main (void) {
printf ("%lg\n", strtod ("Nanomaterial", NULL));
printf ("%lg\n", strtod ("Nano structure", NULL));
printf ("%lg\n", strtod ("infinity is long", NULL));
printf ("%lg\n", strtod ("inferior quality", NULL));
return 0;
}
The above gives "nan", "nan", "inf" and "inf" the few targets I have
tried (including linux and Mac OS). But, as you say, it's not garanteed.
FX
--
François-Xavier Coudert
http://www.homepages.ucl.ac.uk/~uccafco/