http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47007
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #18 from Tobias Burnus <burnus at gcc dot gnu.org> --- Given that we already have some special handling for DECIMAL="comma", I wonder whether one couldn't simply undo the setting by used, e.g., const char *decimal; size_t decimal_len; #if defined USE_LOCALECONV && !defined USE_NL_LANGINFO const struct lconv *lc = localeconv (); #endif #ifdef USE_NL_LANGINFO decimal = nl_langinfo (DECIMAL_POINT); decimal_len = strlen (decimal); assert (decimal_len > 0); #elif defined USE_LOCALECONV decimal = lc->decimal_point; if (decimal == NULL || *decimal == '\0') decimal = "."; decimal_len = strlen (decimal); #else decimal = "."; decimal_len = 1; #endif And then simply replace for decimal_len the existing ("." or ",") decimal character from the read string/file by the one obtained for the local - before sending it to strtof/strtod/strtold/strtoflt128. (Note: decimal_len is probably nearly always == 1, but it might be different.)