Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28385 Discussions

Restriction on STDCALL Attribute with ENTRY Points

wkramer
Beginner
532 Views

Hello,

Since version 10.0 a procedure entry and the procedure must have the same use of the STDCALL attribute.

I used the following code to assure that procedure and entry points all have the STDCALL attribute:

!DEC$ IF DEFINED (_DLL)

!DEC$ATTRIBUTES DLLEXPORT :: VISCOS,VISL,VISV

!DEC$ATTRIBUTES STDCALL, REFERENCE, ALIAS: 'VISCOS_DLL' :: VISCOS

!DEC$ATTRIBUTES STDCALL, REFERENCE, ALIAS: 'VISV_DLL' :: VISV

!DEC$ATTRIBUTES STDCALL, REFERENCE, ALIAS: 'VISL_DLL' :: VISL

!DEC$ ENDIF

However, I still get the following error messages

E:IVFIF97SourceTrpprop.for(60) : Error: A procedure entry and the procedure must have the same use of the STDCALL attribute.   [VISL]
      ENTRY VISL(Pin,Tin)
------------^
E:IVFIF97SourceTrpprop.for(65) : Error: A procedure entry and the procedure must have the same use of the STDCALL attribute.   [VISV]
      ENTRY VISV(Pin,Tin)

The compiler settings are:

Compiling with Intel Fortran Compiler 10.1.013 [IA-32]...
ifort /nologo /Zi /Od /gen-interfaces /warn:interfaces /Qauto /Op /fpconstant /iface:mixed_str_len_arg /module:"Debug/" /object:"Debug/" /traceback /check:bounds /c /DLL /debug-parameters /Qvc7.1 /Qlocation,link,"D:Microsoft Visual Studio .NET 2003Vc7in" "E:IVFIF97SourceWrapper.for"

I have used these settings succesfully under 9.1

Any idea what I am doing wrong?

Walter Kramer

0 Kudos
5 Replies
Steven_L_Intel1
Employee
532 Views
I'd want to see the actual source before I could comment.

The reason for the restriction is that otherwise the compiler would have to track through which entry point you entered in order to determine how to exit.
0 Kudos
wkramer
Beginner
532 Views

Steve,

I hope the following piece of code can help you detect where the problem is.

Thanks,

Walter Kramer

REAL(8) FUNCTION VISCOS(Vin,Tin)

USE STMCOM

IMPLICIT REAL(8)(A-Z)

REAL(8), INTENT(IN) :: Vin,Pin,Tin

INTEGER(4) Ilim

INTEGER(4) L

CHARACTER*8 NAME

CHARACTER*8, SAVE :: NAMEold

REAL(8), SAVE :: Fval,Arg1=-1.D3,Arg2=-1.D3

!DEC$ IF DEFINED (_DLL)

!DEC$ATTRIBUTES DLLEXPORT :: VISCOS,VISL,VISV

!DEC$ATTRIBUTES STDCALL, REFERENCE, ALIAS: 'VISCOS_DLL' :: VISCOS

!DEC$ATTRIBUTES STDCALL, REFERENCE, ALIAS: 'VISV_DLL' :: VISV

!DEC$ATTRIBUTES STDCALL, REFERENCE, ALIAS: 'VISL_DLL' :: VISL

Emsg=.FALSE. ! DON'T SEND ERROR MESSAGES

!DEC$ ENDIF

NAME='VISCOS'

UC=UCin

V=Vin*Vcnv(UC)

T=(Tin+Tcnv2(UC))*Tcnv1(UC)

CALL STMLVL(NAME,V,T)

IF ((V.EQ.Arg1).AND.(T.EQ.Arg2).AND.(NAME.EQ.NAMEold)) GOTO 100

!DEC$ IF DEFINED (_DLL)

CALL MINMAXVT(V,T,Vlow,Vhigh,Tlow,Thigh)

GOTO(1000) ICHKLIM(V,Vlow,Vhigh,

& T,Tlow,Thigh,Xlim,Ylim,Ilim)

!DEC$ ELSE

IF ((T.LT.TMIN).OR.(T.GT.T5MAX+0.01D0)) GOTO 400

IF ((V.LT.VMIN).OR.(V.GT.V5MAX)) GOTO 400

!DEC$ ENDIF

Arg1=V

Arg2=T

NAMEold=NAME

Fval=VISC(1.D0/V,T)

GOTO 100

ENTRY VISL(Pin,Tin)

L=1

NAME='VISL'

GOTO 10

ENTRY VISV(Pin,Tin)

L=0

NAME='VISV'

10

CONTINUE

UC=UCin

P=Pin*Pcnv(UC)

T=(Tin+Tcnv2(UC))*Tcnv1(UC)

CALL STMLVL(NAME,P,T)

IF ((P.EQ.Arg1).AND.(T.EQ.Arg2).AND.(NAME.EQ.NAMEold)) GOTO 100

!DEC$ IF DEFINED (_DLL)

CALL MINMAXPT(P,T,Plow,Phigh,Tlow,Thigh)

GOTO(900) ICHKLIM(P,Plow,Phigh,

& T,Tlow,Thigh,Xlim,Ylim,Ilim)

!DEC$ ELSE

IF ((P.GT.PMAX+0.01D0).OR.(P.LT.PMIN)) G OTO 300

IF ((T.LT.TMIN).OR.(T.GT.T5MAX+0.01D0)) GOTO 300

IF ((P.GT.P5MAX+0.01D0).AND.(T.GT.T2MAX+0.01D0)) GOTO 300

!DEC$ ENDIF

Arg1=P

Arg2=T

NAMEold=NAME

GOTO(101,102,103,104,105) IREGCHKPT(P,T,L)

101

CONTINUE

D=DPT1(P,T)

Fval=VISC(D,T)

GOTO 100

102

CONTINUE

IF (P.LT.P3MIN) THEN

TS=TSAT(P)

IF (T.LT.TS) THEN

TLIM=TMSMIN(P)

IF (T.LT.TLIM) GOTO 300

IF (P.LT.P5MAX) THEN

D=DPT2ms(P,T)

ELSE

D=DPT2(P,T)

ENDIF

ELSE

D=DPT2(P,T)

ENDIF

ELSE

D=DPT2(P,T)

ENDIF

Fval=VISC(D,T)

GOTO 100

103

CONTINUE

IF (L.EQ.0) THEN

D=DPT3G(P,T)

ELSE

D=DPT3L(P,T)

ENDIF

Fval=VISC(D,T)

GOTO 100

104

CONTINUE

GOTO 300

105

CONTINUE

D=DPT5(P,T)

Fval=VISC(D,T)

GOTO 100

100

CONTINUE

VISCOS=Fval/VIScnv(UC)

CALL STMLVLCLR

RETURN

300

CONTINUE

CALL STER(NAME,12,P,T)

RETURN

400

CONTINUE

CALL STER(NAME,42,V,T)

RETURN

900

CONTINUE

VISL=-Ilim*1.D3

RETURN

1000

CONTINUE

VISCOS=-Ilim*1.D3

RETURN

END FUNCTION VISCOS

0 Kudos
Steven_L_Intel1
Employee
532 Views
I tried this with 10.0.027 (with _DLL defined) and got no errors. (I did have to fix up the continuation which did not seem to come across right in this post.)

What specific version of 10.0 are you using?
0 Kudos
wkramer
Beginner
532 Views

I am actually using 10.1.013. I never tried to recompile this specific code under 10.0.

The code belongs to a rather large library for calculation of water and steam properties with a lot of cross references.

There are even some circular references between modules, which are resolved by repeated compilation.

So that is why I didn't post thecomplete code.

Walter Kramer

0 Kudos
Steven_L_Intel1
Employee
532 Views
I get no errors with 10.1.013 either. At this point I suggest you attach a ZIP of your project to an issue submitted to Intel Premier Support.

You should also restructure your code so that you don't have circular module dependencies.
0 Kudos
Reply