This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fortran 90 passing user defined type member to a c fucntion


Toon Moene wrote:
burlen wrote:

In my understanding, Fortran unless otherwise instructed is supposed to pass by address. In the c function modifying the data pointed to should do just that, and be visible to the caller. What I don't understand is why passing the member of a user defined type behaves as if it's passed by value in this case, while passing the corresponding native type is passed by address and works as expected.

Your understanding is ... limited ... (I hesitate to say "wrong", because lots of Fortran compilers implement argument passing the way you describe it).


Please direct GNU Fortran questions to the appropriate forum (fortran@gcc.gnu.org).

Thanks,
gfortran and every other fortran compiler I've seen passes by address. At anyrate, in trying to come up with a simple example to replicate the problem I had with passing user defined types, I found that it's a bug in my code. In the future I have to be more dilligent before posting. Thanks for the help.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]