Re: generic interface question



Yes I have now a small test case which reproduces the trouble :

MODULE a
USE iso_c_binding
INTERFACE
SUBROUTINE foo1(a) BIND(C,name="a_c_routine")
IMPORT C_INT
INTEGER(C_INT) ::a
END SUBROUTINE
END INTERFACE
END MODULE
MODULE b
USE a,ONLY : foo1
INTERFACE foo
MODULE procedure foo1,foo2,foo3
END INTERFACE
CONTAINS
SUBROUTINE foo2(a)
DOUBLE PRECISION ::a
END SUBROUTINE
SUBROUTINE foo3(a)
CHARACTER ::a
END SUBROUTINE
END MODULE

[lcoul@b04p0004 test]$ g95 -c test2.f90
In file test2.f90:13

MODULE procedure foo1,foo2,foo3
1
Error: Cannot change attributes of USE-associated symbol 'foo1' at (1)

.



Relevant Pages

  • Re: compiler switch -c
    ... All methods must be exposed by interface. ... module procedure fruit_summary_ ... end subroutine init_fruit_ ... character, intent, optional:: message ...
    (comp.lang.fortran)
  • Re: generic INTERFACE and name clash
    ... I would define the generic interface name and all of the specifics in one module. ... Unfortunately, the name FOO does not give me the foggiest ideas of what the subroutine does, so I cannot think of a more descriptive subroutine name. ... Module Procedure Foo_I2 ...
    (comp.lang.fortran)
  • Re: generic interface question
    ... END INTERFACE ... Cannot change attributes of USE-associated symbol 'foo1' at ... the critical bit here is that foo1 is *NOT* a module procedure. ... Or put a generic interface block for foo in module a, ...
    (comp.lang.fortran)
  • Re: generic interface question
    ... MODULE procedure foo1,foo2,foo3 ... SUBROUTINE foo2 ... Is that actually what the compiler says, ... INTERFACE odinit ...
    (comp.lang.fortran)
  • Re: generic interface question
    ... END INTERFACE ... MODULE procedure foo1,foo2,foo3 ... Cannot change attributes of USE-associated symbol 'foo1' at ... Or put a generic interface block for foo in module a, ...
    (comp.lang.fortran)