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

Error #8284 with V12 compiler

Brian_Francis
初学者
977 次查看
We are migrating from the V10 to V12 Fortran compiler.

I've got a pile of legacy code that passes a scalar value in place of an array, as in:

call append(1,3)

where the subroutine is defined as:

subroutine append(siz,array)
integer siz,array(siz)

I get an error #8284 complaining that I'm passing a scalar instead of an array.

Is there a "don't worry, be happy" setting on the compiler that will let this compile?

Thanks,

Brian.
0 项奖励
6 回复数
Steven_L_Intel1
977 次查看
There is, but before I tell you about it, let me suggest a simple fix that will make the code correct. Change the call to:

call append(1,[3])

This changes the second argument to an array containing the value 3.

If you really want to run with the blade guard removed, set the property Diagnostics > Check Routine Interfaces to No. I do not recommend this.
0 项奖励
Brian_Francis
初学者
977 次查看

Thanks Steve, but wealso compile the same code under Solaris, AIX, HP-UX and IRIX. I justtried the [ ] syntax in a small test on each of these systems and it fails on all except HP-UX.

What other options do I have (other than setting the check interfaces property)?

Thanks,

Brian.

0 项奖励
mecej4
名誉分销商 III
977 次查看
Older compilers use '(/' and '/)' in place of '[' and ']'. Please try those.
0 项奖励
Brian_Francis
初学者
977 次查看
Oh so close...

IRIX f90 ok
HP-UX f95 ok
AIX xlf ok
Solaris f77 ko

The f95 compiler on Solaris is fine, but for legacy purposes we maintain Solaris 5.5.1 using f77.

Any other suggestions?

Thanks,

Brian.
0 项奖励
Steven_L_Intel1
977 次查看
Unless you're willing to add something like:

INTEGER ONE_ARRAY(1)
DATA ONE_ARRAY /1/

and pass ONE_ARRAY, then disabling generated interface checking is pretty much your only option. You should at least first look at any other errors it gives you to see if they're really code bugs.
0 项奖励
Brian_Francis
初学者
977 次查看
I'm going to disable interface checking for now. This is mostly really old code (almost 30 years) so I don't want to hack at it if I can avoid it. The day I drop the old Solaris f77 compiler (and that day is coming), I'll edit in the \( \) operators and re-enable interface checking.

Thanks Steve for your timely assistance. It's nice to know there is a "go to" guy out there in the Fortran community when things don't go the way we expect.

Happy coding,

Brian.
0 项奖励
回复