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

--- Comment #5 from Khang H. Nguyen <kevin at fai dot host> ---
> program foo
>   integer i
>   read(*,*) i
>   read(*,'(I4)') i
> end program foo
> 
> % gfcx -o z a.f90
> % ./z
> % ./z
> 12 b
> 12 b
> At line 4 of file a.f90 (unit = 5, file = 'stdin')
> Fortran runtime error: Bad value during integer read
> 
> The first '12 b' is read a '12'.  The second read says the 4 characters
> are an integer, so '12 b' generates an error.

For that scenario, you absolutely need to know the format of the string and
can't pass the string without knowing the format then?

Reply via email to