http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59700
--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Do you understand the '++' in

642      dtp->u.p.line_buffer[dtp->u.p.item_count++] = c;

?

program foo

   implicit none

   character(len=80) msg
   integer, parameter :: fd = 10
   integer i1, i2, i3, i4
   real    x1, x2, x3, x4
   complex c1, c2
   logical a, b, c

   open(unit=fd, status='scratch')
   write(fd, '(A)') '1,.true.,2.5,q'

   i1 = 0
   a = .false.
   x1 = 0.0
   rewind(fd)
   msg = 'ok'
   read(fd, *, err=5, iomsg=msg) i1, a, x1, b
5  if (msg /= 'Bad logical value while reading item 4') print *, msg
   print *, i1, a, x1

   rewind(fd)
   write(fd, '(A)') '1 .true. .false. q'

   i1 = 0
   a = .false.
   b = .true.
   rewind(fd)
   msg = 'ok'
   read(fd, *, err=15, iomsg=msg) i1, a, b, c
15 if (msg /= 'Bad logical value while reading item 4') print *, msg
   print *, i1, a, b

   close(fd)

end program foo

gives

 Bad logical value while reading item 3                                         
           1 T   2.50000000    
 Bad logical value while reading item 2                                         
           1 T F

Reply via email to