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

error message relating to assumed size dummy argument could be improved

Jean_U
Beginner
301 Views
The following is just a suggestion to improve error diagnostics.

The compiler correctly fails with an error on the attached code but the error message is less helpfull than it could be:

t1.f90(9): error #5536: Array bounds information needed, but not available for assumed-size array
subroutine foo(x,y)
-----------^
compilation aborted for t1.f90 (code 1)

The actual issue is that the type definition for the dummy argument y has a default initializer which
conflicts with the fact that y is both intent(out) and assumed size.

An error message stating at least which argument has the problem would have helped with the original scenario in which I had multiple assumed size arguments. I hadn't run across this problem before and assume
it is infrequent. Without a nicer error message it took me quite some time to diagnose the actual
problem.

0 Kudos
2 Replies
Kevin_D_Intel
Employee
301 Views
I submitted a feature request (internal tracking id noted below)to consider adding thearray name to the error diagnostic. I will update the thread as I learn more.

(Internal tracking id: DPD200164704)

(Resolution Update on 10/27/2011): This request is fulfilled in the Intel Fortran Composer XE 2011 Update 7 (2011.1.1.256 - Linux)
0 Kudos
Kevin_D_Intel
Employee
301 Views
Your request to indicate which argument the error applies to is fulfilled in the Intel Fortran Composer XE 2011 Update 7 (2011.1.1.256 - Linux).

Your example now generates the following error:
[plain]$ ifort -V -c t1.f90
Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.1.1.256 Build 20111011
Copyright (C) 1985-2011 Intel Corporation.  All rights reserved.

 Intel Fortran 12.1-2076
t1.f90(9): error #5536: Array bounds information needed, but not available for assumed-size array 'Y'.
subroutine foo(x,y)
-----------^
compilation aborted for t1.f90 (code 1[/plain]
0 Kudos
Reply