From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10528 invoked by alias); 22 Oct 2007 06:56:14 -0000 Received: (qmail 10479 invoked by uid 48); 22 Oct 2007 06:56:03 -0000 Date: Mon, 22 Oct 2007 06:56:00 -0000 Message-ID: <20071022065603.10478.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/33162] INTRINSIC functions as ACTUAL argument 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: 2007-10/txt/msg01918.txt.bz2 ------- Comment #8 from burnus at gcc dot gnu dot org 2007-10-22 06:56 ------- (In reply to comment #6) > Created an attachment (id=14381) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14381&action=view) [edit] > Patch to add checks for double specifics This looks wrong: +gfc_check_a_pd (gfc_expr *a, gfc_expr *p) + if (double_check (a, 0) == FAILURE || double_check (a, 0) == FAILURE) (left of || same as right) (In reply to comment #7) > Created an attachment (id=14382) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14382&action=view) [edit] > Preliminary argument checking with intrinsics > > This "draft" patch catches the latest invalid case provided in Comment #4. > This is only checking a simple case of no argument vs there is an argument. I'm not sure this is the right approach, see example in PR 33847 for something gfortran rightfully rejects. gfortran currently has already interface checks, however, there is no interface known for specific intrinsics procedures, which we also need for PROCEDURE. Interesting is whether the following should be accepted or not. NAG f95 and gfortran reject it, g95 and ifort allow it (well, as PR 33847 shows, their checking is rather weak). ----------------------------- module m implicit none contains subroutine sub(a) interface function a(x) real :: a, x intent(in) :: x end function a end interface print *, a(4.0) end subroutine sub end module m use m implicit none EXTERNAL foo ! implicit interface call sub(foo) ! sub's argument has an explicit interface end -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33162