This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gfortran] PATCH: Fix omitted optional CHARACTER arguments


> 2004-06-03  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
>
> 	* gfortran.h (gfc_actual_arglist): New field missing_arg_type.
> 	* interface.c (compare_actual_formal): Keep type of omitted
> 	optional arguments.
> 	* trans-expr.c (gfc_conv_function_call): Add string length
> 	argument for omitted string argument.

Ok. Please also add a a testcase. Maybe something like the following.

Paul

! Test optional character arguments.  We still need to pass a string
! length for the absent arguments
program optional_string_1
  implicit none

  call test(1, "test");
  call test(2, c=42, b="Hello World")
contains
subroutine test(i, a, b, c)
  integer ::  i
  character(len=4), optional :: a
  character(len=*), optional :: b
  integer, optional :: c
  if (i .eq. 1) then
    if (a .ne. "test") call abort
  else
    if (b .ne. "Hello World") call abort
    if (c .ne. 42) call abort
  end if
end subroutine
end program


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]