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

Clarify safety of calling Fortran libraries without BIND(C) #1

Open
krystophny opened this issue Apr 2, 2019 · 0 comments
Open

Clarify safety of calling Fortran libraries without BIND(C) #1

krystophny opened this issue Apr 2, 2019 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@krystophny
Copy link
Collaborator

One should make sure that the way arguments are passed by reference are always consistent. At least for gfortran this seems to be the case. See

https://gcc.gnu.org/onlinedocs/gfortran/Argument-passing-conventions.html
https://gcc.gnu.org/onlinedocs/gfortran/Code-Gen-Options.html
https://thinkingeek.com/2017/01/14/gfortran-array-descriptor/

Subroutines eat pointers with references to data. Array types are specified uniquely via structs. Function return values of primitive types are by value, and as a pointer in more complicated types. Nowadays (post-g77 and f2c) C99 COMPLEX datatype is used.

@krystophny krystophny added the question Further information is requested label Apr 2, 2019
@krystophny krystophny self-assigned this Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant