Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with abstract interface

1 view
Skip to first unread message

Arjen Markus

unread,
Feb 8, 2010, 4:33:51 AM2/8/10
to
Hello,

we ran into a problem with an abstract interface. The code below is
not accepted by the Intel Fortran
compiler (version 11) but is accepted by a recent version of gfortran
(4.4.1):

!module MessageHandlingInterface
! abstract interface
! subroutine callbackiface(level)
! integer, intent(in) :: level
! end subroutine callbackiface
! end interface
!end module MessageHandlingInterface

module MessageHandling
! use MessageHandlingInterface
implicit none

abstract interface
subroutine callbackiface(level)
integer, intent(in) :: level
end subroutine callbackiface
end interface

procedure(callbackiface), pointer :: mh_callback => null()

contains

subroutine SetMessageHandling(callback)
procedure(callbackiface), optional, pointer :: callback

if (present(callback) ) mh_callback =>callback
end subroutine SetMessageHandling

end module

The Intel Fortran compiler complains that the callbackiface interface
is not declared.

Strangely enough, if we move the interface to a separate module, it
does accept the
code. Which compiler is right?

Regards,

Arjen

Tobias Burnus

unread,
Feb 8, 2010, 10:11:59 AM2/8/10
to
On 02/08/2010 10:33 AM, Arjen Markus wrote:
> we ran into a problem with an abstract interface. The code below is
> not accepted by the Intel Fortran
> compiler (version 11) but is accepted by a recent version of gfortran
> (4.4.1):

The code seems to be valid and it compile just fine with a newer version
of ifort (11.1.046).

Tobias

aerogeek

unread,
Feb 8, 2010, 8:26:59 PM2/8/10
to

Yes, i too tested the code with ifort 11.1 and its compiling.

Arjen Markus

unread,
Feb 9, 2010, 2:59:30 AM2/9/10
to

Good to hear that - I will have to ask my IT colleagues about it.

Regards,

Arjen

0 new messages