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

            Bug ID: 105473
           Summary: semicolon allowed when list-directed read integer with
                    decimal='point'
           Product: gcc
           Version: 9.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: john.harper at vuw dot ac.nz
  Target Milestone: ---

List-directed reading of a number should give an error if it reads a semicolon
and decimal is not COMMA but this 9-line program gave the output shown below
it.
(The ifort compiler gave a positive value of ios, which I believe was correct.)

! Does list-directed reading an integer allow some non-integer input?
  implicit none
  integer n,ios
  character(1):: testinput = ';'
  print *,'testinput = "',testinput,'"'
  read(testinput,*,decimal='point',iostat=ios) n
  print *,'n=',n,' ios=',ios
  if(ios>0) print *,'testinput was not an integer'
end program

john@johns-laptop:~/Jfh$ ./a.out
 testinput = ";"
 n=  1458129152  ios=           0
john@johns-laptop:~/Jfh$

Reply via email to