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]
Other format: [Raw text]

[Bug libfortran/36857] Non-English locale breaks gfortran float formatting ("printf is broken")



------- 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


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