[PATCH,fortran]: proposed fix for PR 32732

Tobias Burnus tobias.burnus@physik.fu-berlin.de
Wed Jul 18 21:01:00 GMT 2007


Hi Chris, hi all,

The gcc/fortran/trans-decl.c part seems to be ok.

However, could you modify the gcc/fortran/trans-expr.c fix such that it
works also in the non BIND(C) case; VALUE is not restricted to Bind(c).

*************************************
program test
  implicit none
  character(len=13) :: chr
  chr =  'Fortran       '
  call sub1(chr)
  if(chr /= 'Fortran       ') call abort()
contains
  subroutine sub1(a)
    character(len=13), VALUE :: a
    a = trim(a)//" rules"
    call sub2(a)        ! WRONG: sub2 (&a, 13);
  end subroutine sub1
  subroutine sub2(a)
    character(len=13), VALUE :: a
    print *, a          ! PRINTS GARBAGE
    if(a /= 'Fortran rules') call abort()
  end subroutine sub2
end program test
*************************************

Do you have actually a SVN account or not yet?

Tobias



More information about the Fortran mailing list