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

Fortran2003 : linkconstructor does not have a type with ifort version 13.1.3

Ines_F_
Beginner
361 Views

Hello,

I am getting the following problem when compiling a Fortran 2003 code with ifort  version 13.1.3

error #6404: This name does not have a type, and must have an explicit type.   [LINKCONSTRUCTOR]
    function linkConstructor(value, previous, next)
-------------^
src/linkedList.f03(81): error #6678: When the target is an expression it must deliver a pointer result.
            this%firstLink => link(value, null(), null())
------------------------------------------^
src/linkedList.f03(81): error #6678: When the target is an expression it must deliver a pointer result.   [LINK]
            this%firstLink => link(value, null(), null())

I am compiling successfully the same code on another machine whith ifort version 14.0.2 and running my simulations without any problem.

Could this be in relation with the used version of the ifort compiler ? or did I make a linking mistake or something similar ?

Thanks !

 

0 Kudos
4 Replies
mecej4
Honored Contributor III
361 Views

You showed too little of the code to enable a diagnosis to be made.

If implicit typing is in effect, linkConstructor would be of type INTEGER. Since the compiler complained that it had no type, we can guess that an earlier-seen IMPLICIT NONE is in effect. If that is true, you needed to provide a type declaration for the function name.

Similar comments could be made regarding the types of the other variables and functions.

0 Kudos
Steven_L_Intel1
Employee
361 Views

It could well be a bug in that old compiler. 16.0.2 is current.

0 Kudos
Ines_F_
Beginner
361 Views

 

Thank you for your replies. I commented a certain 'implicit none' in the code and that 's resolved the error 6404 (even if it is working correctly with the version 14.0.2 of the compiler). But I still have this error :

error #6678: When the target is an expression it must deliver a pointer result.   [LINK]
            this%firstLink => link(value, null(), null())

caused by this line :

this%firstLink => link(value, null(), null())

About the same error, I found this :
https://software.intel.com/en-us/articles/error-6678-compiler-defect-with-pointer-assignment-to-a-type-bound-procedure-returning-a-pointer

but I am not sure that it has any relation with the error I m having.

Since it works correctly with ifort version 14.0.2, I supposed too that it's a compiler version problem. I will try to get the latest version in this server and see if this will solve the problem. Thank you ! 

Ines.

0 Kudos
mecej4
Honored Contributor III
361 Views

Ines F. wrote:

I commented a certain 'implicit none' in the code and that's resolved the error 6404 (even if it is working correctly with the version 14.0.2 of the compiler). Since it works correctly with ifort version 14.0.2, I supposed too that it's a compiler version problem. 

If removing IMPLICIT NONE made compiler error messages go away, you should be worried that in your code some variables have not had their types correctly typed. It is not  unusual if a newer version of the compiler catches errors that an older version did not. You should not equate "no error messages" to "no errors". By "working correctly", do you mean "compiled without error messages", or do you actually mean "compiled and ran with no error messages, and delivered results known to be correct"?

0 Kudos
Reply