[Bug fortran/31346] wrong values for ubound and size of deferred shape arrays

pault at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Mar 26 06:19:00 GMT 2007



------- Comment #4 from pault at gcc dot gnu dot org  2007-03-26 07:19 -------
(In reply to comment #3)

> I haven't seen anything in the Fortran 2003 standard forcing the subroutines to
> be in the contains statement.

In this case the interface is said to be implicit and the standard does not
require the programme to do the right thing. Use an INTERFACE, as below, or put
the subroutine in a module.  In either case the interface will be made
explicit.

> But even if it is the case, the compiler should report an error. 

This is not a requirement of the standard but is a long standing regression,
relative to g77.

Confirmed and marked as "diagnostic"

Nous t'en remercions

Cordialement

Paul

      program test

      interface
        subroutine test1(x,y)

        real(kind=8), dimension(:) :: x
        real(kind=8), dimension(:,:) :: y

        end subroutine
      end interface

      real(kind=8), dimension(5) :: test_array
      real(kind=8), dimension(5,5) :: test_array2

      real(kind=8) :: taille


      write(6,*) 'size=', size(test_array)
      write(6,*) 'size=', size(test_array2)
      write(6,*) 'ubound=', ubound(test_array)
      write(6,*) 'ubound=', ubound(test_array2)


      call test1(test_array, test_array2)


      end program

> 


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
      Known to fail|4.1.2                       |4.3.0 4.2.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-26 07:19:26
               date|                            |


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



More information about the Gcc-bugs mailing list