Skip to content

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

@krystophny

Description

@krystophny

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.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions