This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34665] Cannot pass scalar to array argument 'a'
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jan 2008 14:36:59 -0000
- Subject: [Bug fortran/34665] Cannot pass scalar to array argument 'a'
- References: <bug-34665-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from burnus at gcc dot gnu dot org 2008-01-12 14:36 -------
A related but slightly separate issue is illustrated by the following example.
The argument of the second call to FOO is an expression; however, expressions
involving assumed-size arrays are evil. This is detected for assignments:
"Error: The upper bound in the last dimension must appear in the reference to
the assumed size array 'a' at (1)", but not for actual arguments.
(Note: Procedure calls are in so far different as passing the assumed-size
array itself it valid.)
subroutine one(a)
external foo
integer :: a(*)
integer :: b
call foo(a) ! ok
call foo((a)) ! Wrong
call foo(a+1) ! Wrong
b = a+1 ! diagnosed as being invalid
end subroutine
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34665