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

Error #8055: The procedure has a ... VALUE... Required explicit interface is missing from original source.

daninraleigh
Beginner
5,202 Views

I just downloaded and installed the latest update(w_fcompxe_2015.2.179) and am now getting an error that I did not get when using the version from October of 2012(w_fcompxe_novsshell_2013.1.119).

I uninstalled the latest and went back to October 2012 version and do not get the error.

Then installed the latest and get the error again. It appears that something has changed. Do I need to declare the pass by value differently now?

Below is the error I get with the latest version of the Intel Fortran compiler:

Error    3     error #8055: The procedure has a dummy argument that has the ALLOCATABLE, ASYNCHRONOUS, OPTIONAL, POINTER, TARGET, VALUE or VOLATILE attribute. Required explicit interface is missing from original source.   [DATE_ADDR]

Here is the code that calls the function and then the function below:

CHARACTER (LEN=11) :: v_bcdmdhm,tmp_bcdmdhm

tmp_bcdmdhm = v_bcdmdhm( date_addr )

!Get 2 BYTES (4 DIGITS) from Binary Data and return as integer*4

FUNCTION  v_bcdmdhm( addr )
    !DEC$ ATTRIBUTES VALUE :: addr
    IMPLICIT NONE
    
    CHARACTER(len=11) :: v_bcdmdhm
    INTEGER(4)        :: addr
    
    CHARACTER (LEN=4)  :: dt
    CHARACTER (LEN=11) :: mdhm
    INTEGER(2)         :: j    

    CALL v_ch(addr,dt,4)
    WRITE(mdhm,'(Z2.2,''/'',Z2.2,1X,Z2.2,'':'',Z2.2)')  (dt(j:j),j=1,4)
    v_bcdmdhm = mdhm(1:11)

    RETURN
    END FUNCTION  v_bcdmdhm

 

0 Kudos
2 Replies
Andrew_Smith
Valued Contributor I
5,202 Views

The function must be placed inside a module and then have a use statement in the calling code. Or you must declare an interface for the function. That tells the calling code to pass the argument by value. It is good practice to put all code except the main program inside modules.

0 Kudos
Steven_L_Intel1
Employee
5,202 Views

The error message is a bit off, but I understand where it came from.

You are using !DIR$ ATTRIBUTES VALUE to specify that the "addr" argument is passed by value. This is an extension, and there is an assumption that you have made sure that the caller is passing what you expect. My guess is that you are just passing a variable and using ATTRIBUTES VALUE to get the address of the argument. There's nothing particularly wrong with this, though I'll comment that your declaring "addr" to be INTEGER(4) will be wrong for a 64-bit build.

The error message is referring to the VALUE attribute from Fortran 2003, which is NOT the same as the directive, For several years, we treated these as the same, but fixed that in the 14.0 release. If you were using the Fortran 2003 VALUE attribute, which you aren't, then the standard requires that an explicit interface be visible to the caller and you have none. The compiler's optional "generated interface checking" is on by default for new projects, and it is detecting what it thinks is a mismatch. But in this case it shouldn't be treating the directive as the same as the VALUE attribute. I will let the developers know about this. Issue ID is DPD200366702.

The simplest solution for now is to disable generated interface checking - project property Fortran > Diagnostics > Check Routine Interfaces.

0 Kudos
Reply