Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
公告
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Delay load DLL

Adrian_F_1
初學者
1,514 檢視

I am looking at the delay load example under DLL\DLL in the samples in 11.1.065.

This has 

      pointer (p_SET_VENDOR_KEY, SET_VENDOR_KEY)

     INTERFACE
        SUBROUTINE SET_VENDOR_KEY(VENDOR_KEY)
        CHARACTER(LEN=10), INTENT(IN) :: VENDOR_KEY
        END SUBROUTINE SET_VENDOR_KEY
      END INTERFACE

But when I compile I get 

warning #7028: Integer pointer non-standard

warning #7372: Procedures as pointees is not supported in Fortran 2008 standard.   [SET_VENDOR_KEY]

for each of the above constructs respectively.  Is this format being deprecated?

I am compiling in XE 2013 SP1

 

0 積分
5 回應
pbkenned1
員工
1,514 檢視

The 13.1 compiler doesn't complain about that code snippet:

C:\ISN_Forums\U533506>cat U533506.f90
program U533506

pointer (p_SET_VENDOR_KEY, SET_VENDOR_KEY)

     INTERFACE
         SUBROUTINE SET_VENDOR_KEY(VENDOR_KEY)
         CHARACTER(LEN=10), INTENT(IN) :: VENDOR_KEY
         END SUBROUTINE SET_VENDOR_KEY
       END INTERFACE

end program U533506
C:\ISN_Forums\U533506>ifort -c U533506.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.3.198 Build 20130607
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.


C:\ISN_Forums\U533506>

 

Perhaps the sample has been modified or removed in some version after 11.1.  In the 13.1 compiler, I see subfolder 'DynamicLoad' after expanding DLL.zip from the Samples folder -- is that what you are referring to? 

Patrick

 

Patrick

Steven_L_Intel1
1,514 檢視

There has never been a "Delay Load" sample in Intel Visual Fortran. Furthermore, the quoted text does not appear in any of the 11.1 samples, and the samples don't enable standards checking.

It is certainly true that the "integer pointer" syntax is non-standard, so if you ask for standards warnings you'd get that error. Given that, using integer pointers for procedures is also nonstandard, though this seems a bit silly to complain about. The current compiler does give these warnings if you ask for standards warnings, which is correct.

A more recent version of DynamicLoad shows how to do procedure pointers in a standard-conforming manner.

Adrian_F_1
初學者
1,514 檢視

Sorry I meant that by using the DynamicLoad example in the 11.1 Samples directory (DLL\DLL\DynamicLoad), I was able to create a similar bit of code but using my subroutine names.  I have 13.1 and looked at the equivalent there, but did not follow it at all...  so that is why I went back to 11.1 syntax / methods.  But when I implemented this code I got the attached warnings.

So are you saying that the example in 11.1 does not conform with Fortran 2008 standards?

Steve Lionel (Intel) wrote:

There has never been a "Delay Load" sample in Intel Visual Fortran. Furthermore, the quoted text does not appear in any of the 11.1 samples, and the samples don't enable standards checking.

It is certainly true that the "integer pointer" syntax is non-standard, so if you ask for standards warnings you'd get that error. Given that, using integer pointers for procedures is also nonstandard, though this seems a bit silly to complain about. The current compiler does give these warnings if you ask for standards warnings, which is correct.

A more recent version of DynamicLoad shows how to do procedure pointers in a standard-conforming manner.

Adrian_F_1
初學者
1,514 檢視

Yes you need standards checking on to get the messages.  I did see the new version of the example in 13.1 but couldn't work it out, so I went back to the 11.1 version of it.

Patrick Kennedy (Intel) wrote:

The 13.1 compiler doesn't complain about that code snippet:

C:\ISN_Forums\U533506>cat U533506.f90
program U533506

pointer (p_SET_VENDOR_KEY, SET_VENDOR_KEY)

     INTERFACE
         SUBROUTINE SET_VENDOR_KEY(VENDOR_KEY)
         CHARACTER(LEN=10), INTENT(IN) :: VENDOR_KEY
         END SUBROUTINE SET_VENDOR_KEY
       END INTERFACE

end program U533506
C:\ISN_Forums\U533506>ifort -c U533506.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.3.198 Build 20130607
Copyright (C) 1985-2013 Intel Corporation.  All rights reserved.

C:\ISN_Forums\U533506>

 

Perhaps the sample has been modified or removed in some version after 11.1.  In the 13.1 compiler, I see subfolder 'DynamicLoad' after expanding DLL.zip from the Samples folder -- is that what you are referring to? 

Patrick

 

Patrick

Steven_L_Intel1
1,514 檢視

Correct - the 11.1 sample is nonstandard. But that's often the case when calling Windows APIs.

回覆