Prev: Which version of Intel Fortran 1st had C Interop?
Next: Error when compiling using gcc440 (compiles fine with gcc412)- missing actual arg:
From: Christian Cardall on 13 Dec 2009 21:37 In Fortran 2003, consider two specific type-bound procedures (e.g. IntegerShow and CharacterShow), and an associated generic type-bound procedure (e.g. generic :: Show => IntegerShow, CharacterShow). With a call such as call x%IntegerShow(...) the pass-object behavior is as expected. But (at least with the Cray compiler) if I try to invoke the routine via the generic binding, I have to say call x%Show(x, ...) for it to compile. That is, the passed-object behavior does not seem to apply to the generic binding! Is that the expected behavior according to the standard? It is extremely annoying. Best regards, Christian Cardall Oak Ridge National Laboratory
From: Christian Cardall on 13 Dec 2009 22:45
Update: I find that I get the desired passed-object behavior with the generic binding if I use the PASS attribute in declaring the specific type-bound procedures. It seems strange that this should be necessary, as my understanding is that PASS with no argument specification is supposed to just confirm the default behavior. (Again, this is with the Cray compiler.) Best regards, Christian Cardall Oak Ridge National Laboratory |