From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3787 invoked by alias); 24 Jun 2009 12:59:40 -0000 Received: (qmail 3737 invoked by uid 48); 24 Jun 2009 12:59:28 -0000 Date: Wed, 24 Jun 2009 12:59:00 -0000 Message-ID: <20090624125928.3736.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/39997] Procedure(), pointer & implicit typing: rejects-valid / accepts-invalid? In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg01770.txt.bz2 ------- Comment #4 from burnus at gcc dot gnu dot org 2009-06-24 12:59 ------- (In reply to comment #3) Regarding the implicit typing: I think it would be easiest to apply the implicit typing for module m external foo end module m at resolution time, such that "foo" is marked as ts.type = "real", ts.kind = 4, but such that one still knows that "foo" can still be a subroutine. One probably needs another flag, but maybe the one can re-use a current flag without ambiguity arising. The challenge is to find all places where BT_UNKNOWN is checked to for functions/subroutines/procedure (pointers) - be it in interface/symbol/resolve or in trans*.c. We don't need another flag if (!attr.functions && attr.implicit_type) can never occur with the current code. Or when we can use attr.untyped somehow. In any case writing a single flag (per symbol) to the .mod file is easier that dumping the complete implicit typing stuff there and applying the right type to the host-associated variable. Another test case, currently works, but still needs to work after fixing the implicit stuff: module m implicit logical(1)(a-z) external proc end module m use m call proc() end * * * Proc-pointer assignment of "ptr => Function" w/ "ptr" with "ptr" being implicitly typed (including null mapping -> SUBROUTINE), where the function-return-type does not match the implicit type for ptr: This still does not produce an error. Maybe it can be fixed as part of PR 40541 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39997