Error 6219 while using PARAMETER

Error 6219 while using PARAMETER

We're having some difficulties in compiling some source that uses a PARAMETER to dimension an array.  However, the error only comes up under certain circumstances.  The error message we receive is:

error #6219: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association [CONSTINT]

Compile command used was "ifort -c -warn interfaces ifort6219.for".  If you remove the "-warn interfaces", it works.  If you remove the "header guards", it works.  If you remove the call to an unrelated subroutine, it works.  Al three together, and you get a #6219 error.

> ifort -version

Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version Build 20120731

$ ifort -V

Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version Build 20110427

(The error is encountered on both Windows and Linux, so I included the versions of both platforms we were testing it on.  Posting it here, because this is where I spend most of my time.)

Downloadapplication/octet-stream ifort6219.for251 bytes
6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hopefully your code is just a non-representative sample ---otherwise, the compilation will always fail if _ConstInt_Included_ happens to be defined.

The "-warn interfaces" flag not only warns, but also generates interface blocks (i.e., some *__genmod.f90 files are generated), and maybe those are the ones conflicting with the DEC$ lines.

I always avoid the generation of interface blocks, either by using modules or by using the -nogen-interfaces flag.

Changing the DEC$ lines by fpp lines (#ifndef, #define, #endif, etc.), also solves your problem ---provided the file extension is in uppercase or the -fpp flag is passed to the compiler.

It's just a reproducer. The header guards are actually inside another file that is called up via an INCLUDE statement, and is possible that it may be included multiple times by way of header file chaining, hence the DEC$ lines. We are checking interfaces because our program contains thousands of source files and we want to ensure function call consistency across all of them, so simply removing them is not an option.

I see the problem - thanks. The general issue is that when -warn interface is used, we parse the source twice. We've seen a number of issues in the past caused by not resetting certain things on the second parse, and it looks as if the defines are among those. I will report this to the developers. The issue ID is DPD200237770.

If you used the cpp-style of conditional compilation, with #ifdef you could avoid the problem (requires -fpp or naming the source file with .FOR).

Retired 12/31/2016

Ok, thanks. Unfortunately, changing over to F90/C-style syntax requires us to change a number of other things (i.e. INCLUDE 'filename.text" to #include 'filename.text'), of which there are a few thousand. So we'll just disable prototype checking for the time being until the fix comes out.


I expect the fix to be in Update 2, planned for late January.

Retired 12/31/2016

Leave a Comment

Please sign in to add a comment. Not a member? Join today