This is the mail archive of the
mailing list for the GCC project.
Re: [patch, fortran] fixes for the EXIT intrinsic function (PR30933)
- From: Brooks Moses <brooks dot moses at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org
- Date: Fri, 23 Mar 2007 14:02:43 -0700
- Subject: Re: [patch, fortran] fixes for the EXIT intrinsic function (PR30933)
- References: <45DF2C6A.email@example.com>
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!
2007-02-23 Tobias Burnus <firstname.lastname@example.org>
* intrinsic.c (add_functions): Correct name of dummy argument.
--- 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)