Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
15 Views

Error 7371 with save attribute in submodule routine

Hi,

i was placing some routines in submodules, when i stumbled upon this error:

error #7371: An object in a COMMON block with DEC$ ATTRIBUTES DLLIMPORT cannot be initialized. [BAR]

Reproducer:

module M_TEST
  implicit none

  interface

    module real function foo()
      !DIR$ ATTRIBUTES DLLEXPORT,ALIAS:"foo" :: foo
    end function

  end interface

end module


submodule(M_TEST) M_TEST_S
  implicit none

  contains
    module real function foo()
      !DIR$ ATTRIBUTES DLLEXPORT :: foo

      real, save :: bar = 1.0 ! Explicit save not required for error

      foo = 1.0
    end function

end submodule

Compiler: 16.3.207
Options: /dll /nologo

Best regards,

Wolf

0 Kudos
1 Reply
Highlighted
15 Views

Thanks for reporting the issue. I have reproduced it and opened a defect report DPD200413429 for it.

Thanks,

Xiaoping Duan

Intel Customer Support

0 Kudos