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 fortran/47007] Values from namelist file should not depend on locale settings


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47007

--- Comment #12 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-19 21:32:49 UTC ---
Vaguely related: PR 35862 (rounding on input). Both PR 35862 and this PR seem
to require writing a libgfortran-specific version of
strtof/strtod/strtold/quadmath_strtopQ - currently, the system's version is
called in convert_real.

The only alternatives I see are:
a) To reset the locale for every READ statement ('setlocale(LC_NUMERIC, "C")')
- and restore it afterwards.
b) To use localeconv and convert the decimal sign appropriately in the string
(as currently done for DECIMAL="comma") - again, this needs to happen for every
READ statement
c) Simply document (gfortran.texi) that messing around with "setlocale" might
produce surprising results. [LC_ALL/LANG environment variables do not have any
effect unless "setlocale" is explicitly called. Cf.
http://www.opengroup.org/onlinepubs/007904875/functions/setlocale.html]

I think (a) and (b) are (too) slow and cumbersome and regarding (c): No one
reads the documentation.


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