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

Reply via email to