[Bug fortran/78351] comma not terminating READ of formatted input field - ok in 4.1.7, not 4.4.7- maybe related to 25419?
sgk at troutmask dot apl.washington.edu
gcc-bugzilla@gcc.gnu.org
Thu Nov 17 02:10:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78351
--- Comment #19 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Nov 17, 2016 at 12:43:40AM +0000, kevin.b.beard at nasa dot gov wrote:
> Many thanks to Jerry DeLisle [jvdelisle@charter.net]; he made us realize
> that an internal record is now not treated the same as an external record!
Ugh. It ought to be treated the same.
> I didn't think of that.
>
> In the attached example, you see "1,2,3,,,," read from a file with
>
> READ(1,'(2i10)') i,j
>
> DOES still work in gfortran 4.4.7, but
This is a bug that needs to be fixed.
> READ(1,'(a)') line
> READ(line,'(2i10)') i,j
>
> does NOT.
Standard conforming behavior as I have now pointed out in 3 posts.
> If one parses the string appropriately and reads
> it one part of a time, it does work:
>
> READ(line(1:1),'(i10)') i
> READ(line(3:3),'(i10)') j
In the above, you are hitting an end-of-record. I would need
to go read the Standard to see what happens in this situation.
I suspect that this may be Standard conforming, but the variables
i and j are undefined and technically cannot be referenced until
the variables become defined.
More information about the Gcc-bugs
mailing list