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: [PATCH] Make NEXTREC specifier for INQUIRE work for large record numbers


On Sat, Nov 18, 2017 at 12:34 PM, Janne Blomqvist
<blomqvist.janne@gmail.com> wrote:
> This is accomplished by making the NEXTREC specifier be a 8 byte
> integer where supported.
>
> I wasn't able to come up with a testcase that does not create a large
> file that could be added to the testsuite, but here's one which
> creates a 2 GB file:
>
> program nextrec
>   implicit none
>   integer(8) :: ii, n
>   open(10, file="foo.dat", recl=1, access="direct", form="unformatted", status="replace")
>   do ii = 1, huge(1) + 2_8
>      write(10, rec=ii) 'a'
>   end do
>   inquire(10, nextrec=n)
>   if (n /= huge(1) + 2_8) then

This statement should of course be

if (n /= huge(1) + 3_8) then


-- 
Janne Blomqvist


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