public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47984] New: Pointer dummy argument mismatch not detected by Fortran compiler
@ 2011-03-04  8:31 thenlich at users dot sourceforge.net
  2011-03-04 15:47 ` [Bug fortran/47984] " kargl at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: thenlich at users dot sourceforge.net @ 2011-03-04  8:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47984

           Summary: Pointer dummy argument mismatch not detected by
                    Fortran compiler
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: thenlich@users.sourceforge.net


Created attachment 23539
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23539
Test case

The Fortran compiler does not detect a mismatch between an actual argument (not
a pointer) and a dummy argument in a procedure (which is a pointer, by mistake)
in this example:

program test_pointer
    type :: t
        integer :: i = 7
    end type
    type(t), target :: a
    call testsub(a%i)
contains
    subroutine testsub(p)
        integer, pointer, intent(in) :: p
        print *, p
    end subroutine
end

Result: The program compiles without errors.

Expected result: The compiler should report an error like

test_pointer.f90:6.17:

    call testsub(a%i)
                 1
Error: Actual argument for 'p' must be a pointer at (1)


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-07  6:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-04  8:31 [Bug fortran/47984] New: Pointer dummy argument mismatch not detected by Fortran compiler thenlich at users dot sourceforge.net
2011-03-04 15:47 ` [Bug fortran/47984] " kargl at gcc dot gnu.org
2011-03-04 17:10 ` burnus at gcc dot gnu.org
2011-03-04 18:58 ` thenlich at users dot sourceforge.net
2011-03-04 19:16 ` sgk at troutmask dot apl.washington.edu
2011-03-04 19:40 ` burnus at gcc dot gnu.org
2011-03-07  6:26 ` thenlich at users dot sourceforge.net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).