This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, fortran] PR36355: fix argument type checking for matmul
- From: Tobias Burnus <burnus at net-b dot de>
- To: Daniel Franke <franke dot daniel at gmail dot com>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 28 May 2008 16:59:12 +0200
- Subject: Re: [patch, fortran] PR36355: fix argument type checking for matmul
- References: <640ad44b0805280503m1b1e968ds78357844a17368e7@mail.gmail.com>
Daniel Franke wrote:
The diagnosed error is correct, but gives the wrong argument name as
the culprit (see PR for an example). The fix is quite obvious, I will
commit it in 24 h ours if there are no objections.
OBJECTION. I think the current/old logic is OK with regards of rejecting
and accepting arguments; I agree that the message might be misleading.
There are the following cases and you only regarded (a) and (b), but not
(c) and (d):
a) a=[logical/numeric], b = invalid(e.g. character)
b) a = invalid(e.g. character), b=[logical/numeric]
c) a=logical, b = numerical
d) a=numerical, b = logical.
Test program, which should be rejected:
integer :: a(4,4)
logical :: b(4,4)
print *, matmul(a,b)
end
With your patch it is accepted, but a "Warning: Extension: Conversion
from INTEGER(4) to LOGICAL(4)" is printed. Note that even the very
generous ifort rejects that program.
Tobias