[patch, fortran] fixes for the EXIT intrinsic function (PR30933)

Brooks Moses brooks.moses@codesourcery.com
Fri Mar 23 21:47:00 GMT 2007


:REVIEWMAIL:

Tobias Burnus wrote:
> The following patch does the following
> 
> a) Correct the dummy argument name; for "exit(status)" (is was "code"
> instead of "status") and for "new_line(A)" (it was "i").
> 
> b) It allows any integer kind for the exit subroutine. This is in the
> spirit of Fortran 2003 which also allows any kind for most of the
> intrinsic procedures. Status quo is to give a link-time error that
> exit_i1 etc. does not exist.
[...]

The patch for part (a) -- which should be just the intrinsic.c parts I 
quoted below, yes? -- is ok for trunk, although the changelog should 
mention the "new_line" and "exit" intrinsics.

My feeling at this point is that part (b) is something that should be 
solved in a consistent and systemic fashion, as was discussed in other 
threads after you posted this patch; thus, I don't think it's useful to 
fix it in a piecemeal manner now.

Thanks for working on this!

- Brooks


> fortran/
> 2007-02-23  Tobias Burnus  <burnus@net-b.de>
> 
> 	PR fortran/30933
> 	* intrinsic.c (add_functions): Correct name of dummy argument.
> 
> Index: gcc/fortran/intrinsic.c
> ===================================================================
> --- gcc/fortran/intrinsic.c	(revision 122263)
> +++ gcc/fortran/intrinsic.c	(working copy)
> @@ -1911,7 +1911,7 @@
>  
>    add_sym_1 ("new_line", NOT_ELEMENTAL, ACTUAL_NO, BT_CHARACTER, dc,
>  	     GFC_STD_F2003, gfc_check_new_line, gfc_simplify_new_line, NULL,
> -	     i, BT_CHARACTER, dc, REQUIRED);
> +	     a, BT_CHARACTER, dc, REQUIRED);
>  
>    add_sym_2 ("nint", ELEMENTAL, ACTUAL_YES, BT_INTEGER, di, GFC_STD_F77,
>  	     gfc_check_a_ikind, gfc_simplify_nint, gfc_resolve_nint,
> @@ -2457,7 +2457,7 @@
>  
>    add_sym_1s ("exit", 0, BT_UNKNOWN, 0, GFC_STD_GNU,
>  	      gfc_check_exit, NULL, gfc_resolve_exit,
> -	      c, BT_INTEGER, di, OPTIONAL);
> +	      st, BT_INTEGER, di, OPTIONAL);
>  
>    if ((gfc_option.allow_std & GFC_STD_GNU) || gfc_option.flag_all_intrinsics)
>      make_noreturn();



More information about the Gcc-patches mailing list