This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/34665] Cannot pass scalar to array argument 'a'



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]