This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] patch for pr15472 and sequential unformatted I/O


> went over the logic (executed with printf's in the code!) both
> with a terminal device and a fifo. both give error messages when
> seeks are attempted, and s->file_length is not overwritten.
>
> test results unchanged.  no test suite failures i686/gnu/linux.
>
> --bud
>
>
> Index: unix.c
> ===================================================================
<...>
> !   /* don't increment file_length if the file is non-seekable */
> !   if (s->file_length != -1 )
> !     if (s->physical_offset > s->file_length)
> !       s->file_length = s->physical_offset;
>     s->ndirty = 0;

Coding conventions require braces for the outer if statement.
The second if is superfluous, ie. 
  if (s->file_length != -1 && s->physical_offset > s->file_length)

Ok with that change (don't forget the ChangeLog).

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]