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

--- Comment #8 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Wed, Mar 13, 2019 at 07:17:42PM +0000, kevin at fai dot host wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89696
> 
> --- Comment #6 from Khang H. Nguyen <kevin at fai dot host> ---
> Sorry, if I am wasting your time.

bugzilla isn't meant for Fortran tutorials.  This is my last
response.

> 
> If you use formatting. For example, in a case like this below,
> it will not give a correct value, as now leading spaces will
> be disregarded but no error is thrown. This code below will
> give 124
> 
> program test1
>     implicit none
>     character(len=100)  ::  str
>     integer             ::  b
>     str = " 1245 ab "
>     read(str, '(I4)') b
>     print *, b
> end program test1
> 

The program is giving the correct answer for the string given.
I4 means read the 1st 4 characters.  Those characters are ' 124'.
The rest of the string is ignored.

Reply via email to