This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Implementing new intrinsic
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: FX Coudert <Francois-Xavier dot Coudert at lcp dot u-psud dot fr>
- Cc: GCC Fortran mailing list <fortran at gcc dot gnu dot org>
- Date: Mon, 24 Jan 2005 15:22:35 -0800
- Subject: Re: Implementing new intrinsic
- References: <41F57C3D.5090603@lcp.u-psud.fr>
On Mon, Jan 24, 2005 at 11:52:45PM +0100, FX Coudert wrote:
>
> In a effort to contribute to gfortran, I tried to write a missing
> intrinsic (rename), following instructions given in a recent thread here
> on the files to modify to write a new intrinsic. However, most things
> were written by comparing and guessing, and I'm not sure of what I have
> written.
Comparing and guessing is the method I use(d). Paul has been
patient with me. :-)
>
> try
> +gfc_check_rename (gfc_expr * path1, gfc_expr * path2)
> +{
> + if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
> + return FAILURE;
> +
> + if (type_check (path2, 0, BT_CHARACTER) == FAILURE)
type_check (path2, 1, BT_CHARACTER)
The 2nd argument to type_check() is the number of the argument.
path1 = 0, path2 = 1.
> +
> +try
> +gfc_check_rename_sub (gfc_expr * path1, gfc_expr * path2, gfc_expr * status)
> +{
> + if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
> + return FAILURE;
> +
> + if (type_check (path2, 0, BT_CHARACTER) == FAILURE)
> + return FAILURE;
Same as the above.
> + if (status == NULL)
> + return SUCCESS;
> +
>From a quick glance, the rest looks okay to me.
I assume you have tested your patch.
--
Steve