This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54190] New: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Aug 2012 15:36:38 +0000
- Subject: [Bug fortran/54190] New: TYPE(*)/assumed-rank: Type/rank check too relaxed for dummy procedure
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54190
Bug #: 54190
Summary: TYPE(*)/assumed-rank: Type/rank check too relaxed for
dummy procedure
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
The following program is invalid and should print
Error: Interface mismatch in dummy procedure 'x' at (1): Type/rank mismatch
in argument 'x'
See interface.c's compare_type_rank and its callers.
However, due to the TYPE(*), not error is printed. I suspect that for
assumed-rank ("dimension(..)") a similar issue exists, but it could be already
caught by the as.type checks.
Cf. http://gcc.gnu.org/ml/fortran/2012-08/msg00034.html
As extension, the check could be split. Namely, one should get a separate error
for TYPE and for RANK, the former should use gfc_typename() to print the types
(and the kinds), the latter should also be printed. (Either deferring
assumed-rank to a later check or specially handling the case rank==-1.)
! Example:
implicit none
contains
subroutine g(x)
integer :: x
end subroutine g
subroutine f(x)
type(*) :: x
end subroutine f
subroutine sub(x)
procedure(g) :: x
end subroutine sub
subroutine test()
call sub(f) ! INVALID: "f" has an argument 'x' of TYPE(*) instead of integer
end subroutine test
end