https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61847
--- Comment #12 from e2cd58e1 at opayq dot com ---
Sorry but I still have a problem with this, maybe I didn't get what you are
saying or I wasn't clear enough.
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?
----------------- bug.c --------------
#include <stdlib.h> /* strtod */
#include <locale.h>
#include <stdio.h>
int badcall_();
int main()
{
setlocale(LC_ALL, "de_DE.UTF-8");
badcall_();
return 0;
}
----------------- bug.dat --------------
1.2345
----------------- bugf.f90 --------------
subroutine badcall()
implicit none
double precision :: res
open(unit=1,file='bug.dat',decimal="point")
read(1,*) res
write(*,*) 'res =', res
end subroutine badcall