(j3.2006) Suggestion for Fortran 201x: Adding support for ignoring the TKR of the actual argument
Bill Long
longb
Fri Mar 1 18:01:18 EST 2013
On 2/28/13 4:49 PM, Tobias Burnus wrote:
> Several compilers support some option to allow for the Fortran
> equivalent to C's "void *buffer" using a directive such as:
>
> !DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
> !$PRAGMA IGNORE_TKR buf
> !DIR$ IGNORE_TKR buf
> !IBM* IGNORE_TKR buf
>
> There is unfortunately no way to do this in standard Fortran. The
> closest are:
>
> * TYPE(*), DIMENSION(*) - which doesn't allow for scalars but only
> arrays and array elements
TYPE(*) works for scalars (no dimension...). If you have only one of
the buffer arguments (which is typical) the you can make the routine
generic, with one argument scalar and the other an array. And give both
specifics the same binding name (of the C function that will accept
either). It is sort of involved, but does not involve any modifications
to the standard.
Cheers,
Bill
> * TYPE(*), DIMENSION(..) - which not only passes the address of the data
> but the full array descriptor
>
> Thus, something like dimension(**) could be useful, which works like
> dimension(*) but also accepts scalars.
>
> Tobias
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3
>
--
Bill Long longb at cray.com
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
More information about the J3
mailing list