Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26755 Discussions

Erroneous error #7281: This symbol has multiply declared DEC$ ATTRIBUTES REFERENCE{32|64] attribute with a MODULE SUBROUTINE

FortranFan
Honored Contributor II
107 Views

Fyi on a support requested at the Intel OSC:

module m

   interface
      module subroutine sub( s )
         !dir$ attributes stdcall, reference, mixed_str_len_arg :: sub
         !dir$ attributes decorate, alias:'sub' :: sub

         character(len=*), intent(in) :: s

      end subroutine sub

   end interface

end module

submodule(m) sm

contains

   module subroutine sub( s )
      !dir$ attributes stdcall, reference, mixed_str_len_arg :: sub
      !dir$ attributes decorate, alias:'sub' :: sub

      character(len=*), intent(in) :: s

      print *, s

   end subroutine sub

end submodule

and the compilation response:

C:\temp>ifort /c /standard-semantics /warn:all m.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R
) 64, Version 18.0.1.156 Build 20171018
Copyright (C) 1985-2017 Intel Corporation. All rights reserved.

m.f90(21): error #7281: This symbol has multiply declared DEC$ ATTRIBUTES REFERE
NCE{32|64] attribute. [SUB]
!dir$ attributes stdcall, reference, mixed_str_len_arg :: sub
-------------------------------------------------------------^
compilation aborted for m.f90 (code 1)

I think the above shown error #7281: This symbol has multiply declared DEC$ ATTRIBUTES REFERENCE{32|64] attribute. should not occur.  The listed attributes in the SUBMODULE with the module subroutine sub are the same as those in the ancestor module.   I believe Intel Fortran should be able to support this.

I have requested a fix for this issue.

0 Kudos
0 Replies
Reply