[Bug fortran/61847] bug in gfortran runtime: digits cut off when reading floating point number

jvdelisle at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 22 03:29:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61847

--- Comment #14 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to e2cd58e1 from comment #12)
--- snip ---
> Suppose I cannot change the C-wrapper and the locale might be set to
> whatever. The file bug.dat already exists and uses point decimals. So I want
> a fortran routine that always reads in a file in the usual point separated
> format. 
> 
> If in the fortran routine I call
> 
>     open(unit=1,file='bug.dat', decimal="point")
> 
> I expect the keyword to be more important than the locale setting: I
> explicitly specify to read point separated values, but in the example below,
> it still returns 1.00000 instead of 1.2345. Is that really expected behavior?
> 

My first bad assumption was that for some reason you wanted the current locale,
whatever it is, to remain active. My second bad assumption was that you could
easily change your C-wrapper.  :)

In reading up on the locale business, setting locale to "POSIX" is suppose to
be fully portable.

So, we could easily force the locale to POSIX in the open statement.  I need to
think about whether this will mess up something else.



More information about the Gcc-bugs mailing list