Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-F2003 feature? Use of c_loc() with assumed-shape arrays #9

Closed
albgar opened this issue Jul 12, 2020 · 1 comment
Closed

Non-F2003 feature? Use of c_loc() with assumed-shape arrays #9

albgar opened this issue Jul 12, 2020 · 1 comment

Comments

@albgar
Copy link

albgar commented Jul 12, 2020

Using an oldish (4.8.5) version of gfortran, I found the following error:

gfortran -c -o flook.o  -Iaotus/obj  ./src/flook.F90
./src/flook.F90:1681.16:

    ptr = c_loc(val)
                1
Error: Assumed-shape array 'val' at (1) cannot be an argument to the procedure 'c_loc' because it is not C interoperable

Support for interoperability of assumed-shape arrays is not part of Fortran 2003. It is codified in a supplement, and is part of Fortran 2018:

The Technical Specification ISO/IEC TS 29113:2012 on further interoperability of Fortran with C extends the interoperability support of Fortran 2003 and Fortran 2008. Besides removing some restrictions and constraints, it adds assumed-type (TYPE(*)) and assumed-rank (dimension) variables and allows for interoperability of assumed-shape, assumed-rank and deferred-shape arrays, including allocatables and pointers.

On the other hand, ifort 17 and not-very-new versions of gfortran work well.

@zerothi
Copy link
Contributor

zerothi commented Jul 27, 2020

Agreed! I will fix this! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants