This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/36857] Non-English locale breaks gfortran float formatting ("printf is broken")
- From: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2008 23:14:23 -0000
- Subject: [Bug libfortran/36857] Non-English locale breaks gfortran float formatting ("printf is broken")
- References: <bug-36857-16480@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from jvdelisle at gcc dot gnu dot org 2008-07-19 23:14 -------
I should clarify something here. At this time, gfortran does not have its own
dtoa() function. We are using snprintf (or sprintf) to write to a char buffer.
This is done to extract the digits. We then process this string in the buffer
to form the necessary formatted output.
The internal error is a sanity check only to assure that the decimal point came
out in the expected position at buffer[2]. It is useful for debugging as an
indicator that the printf function is working. This is particularly useful
since on some platforms it has been found to be broken or not behaving as
expected.
That decimal point is not actually ever output by gfortran. Separate code in
the library emits the "point" or "comma" per the standard according to the
settings of the decimal= specifier.
What I propose to do is modify the sanity check to accept a comma or a point.
In the future, if we ever come up with a better dtoa() or do some other
enhancements in this part of the library, this sanity code is likely to go
away.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36857