WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

[Patch, fortran] PR 39654 FTELL intrinsic

View: New views
3 Messages — Rating Filter:   Alert me  

[Patch, fortran] PR 39654 FTELL intrinsic

by Janne Blomqvist-3 :: Rate this Message:

| View Threaded | Show Only this Message

Hi,

the attached patch makes the FTELL intrinsic function work on offsets
larger than 2 GB on 32-bit systems that support large files. As this
is an ABI change the old library function is left untouched, to be
removed when/if the library ABI is bumped.

Regtested on x86_64-unknown-linux-gnu, Ok for trunk?

frontend ChangeLog:

2012-06-21  Janne Blomqvist  <jb@...>

        PR fortran/39654
        * iresolve.c (gfc_resolve_ftell): Fix result kind and use new
        library function.


library ChangeLog:

2012-06-21  Janne Blomqvist  <jb@...>

        PR fortran/39654
        * io/intrinsics.c (ftell2): New function.
        * gfortran.map (_gfortran_ftell2): Export function.


--
Janne Blomqvist


ftell.diff (2K) Download Attachment

Re: [Patch, fortran] PR 39654 FTELL intrinsic

by Tobias Burnus :: Rate this Message:

| View Threaded | Show Only this Message

On 06/20/2012 11:28 PM, Janne Blomqvist wrote:
> the attached patch makes the FTELL intrinsic function work on offsets
> larger than 2 GB on 32-bit systems that support large files. As this
> is an ABI change the old library function is left untouched, to be
> removed when/if the library ABI is bumped.
>
> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?

The patch is okay; however, I wonder whether a name like "ftell64" or
"ftell8" and a comment mentioning additionally the large-file support
will help when reading the file.

Thanks for the patch.

Tobias

> 2012-06-21  Janne Blomqvist  <jb@...>
>
> PR fortran/39654
> * iresolve.c (gfc_resolve_ftell): Fix result kind and use new
> library function.
>
>
> library ChangeLog:
>
> 2012-06-21  Janne Blomqvist  <jb@...>
>
> PR fortran/39654
> * io/intrinsics.c (ftell2): New function.
> * gfortran.map (_gfortran_ftell2): Export function.
>
>



Re: [Patch, fortran] PR 39654 FTELL intrinsic

by Janne Blomqvist-3 :: Rate this Message:

| View Threaded | Show Only this Message

On Thu, Jun 21, 2012 at 3:34 PM, Tobias Burnus <burnus@...> wrote:

> On 06/20/2012 11:28 PM, Janne Blomqvist wrote:
>>
>> the attached patch makes the FTELL intrinsic function work on offsets
>> larger than 2 GB on 32-bit systems that support large files. As this
>> is an ABI change the old library function is left untouched, to be
>> removed when/if the library ABI is bumped.
>>
>> Regtested on x86_64-unknown-linux-gnu, Ok for trunk?
>
>
> The patch is okay; however, I wonder whether a name like "ftell64" or
> "ftell8"

I considered that, but since gfc_intio_kind is not guaranteed to be 8
I thought it wouldn't be a good choice. So I just used a simple
sequential number; it shouldn't matter that much anyway since it's not
visible to the user.

> and a comment mentioning additionally the large-file support will
> help when reading the file.

I enhanced the comment above the ftell2 function in libgfortran to
hopefully explain the issue better.

> Thanks for the patch.

Thanks for the quick review! Committed as r188858.

--
Janne Blomqvist