This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran, patch] Remove parentheses and comma in error message.
- From: Tobias Burnus <burnus at net-b dot de>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 05 Oct 2006 11:00:34 +0200
- Subject: Re: [fortran, patch] Remove parentheses and comma in error message.
- References: <4524C246.5060005@net-b.de>
I knew I would forget something:
2006-10-05 Tobias Burnus <burnus@net-b.de>
* fortran/trans.c: Change error-message format in
gfc_trans_runtime_check
Tobias
Tobias Burnus wrote:
> This patch removes the "( , )" in the error message function
> gfc_trans_runtime_check().
> This is used by the array checks (bounding error, strides) and for the
> format-label errors; it also will be used by the substring check (review
> pending).
>
> This change was suggested by Steve; I also prefer it to the current version.
>
> Old/current error message (example):
> ---------------
> Fortran runtime error: Array reference out of bounds for array 'a',
> upper bound of dimension 1 exceeded (in file 'string2.f90' at line 6)
> ---------------
>
> New/proposed error message (example):
> ---------------
> Fortran runtime error: Array reference out of bounds for array 'a',
> upper bound of dimension 1 exceeded in file 'string2.f90' at line 6
> ---------------
>
> All the testcases, I found, use something like
> "upper bound of dimension 1 exceeded.*at line 6" and are thus not
> affected by this patch.
>
> Tobias
>
> ------------------------------------------------------------------------
>
> Index: gcc/fortran/trans.c
> ===================================================================
> *** gcc/fortran/trans.c (Revision 117449)
> --- gcc/fortran/trans.c (Arbeitskopie)
> *************** gfc_trans_runtime_check (tree cond, cons
> *** 329,339 ****
> #else
> line = where->lb->linenum;
> #endif
> ! asprintf (&message, "%s (in file '%s', at line %d)", _(msgid),
> where->lb->file->filename, line);
> }
> else
> ! asprintf (&message, "%s (in file '%s', around line %d)", _(msgid),
> gfc_source_file, input_line + 1);
>
> tmp = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const(message));
> --- 329,339 ----
> #else
> line = where->lb->linenum;
> #endif
> ! asprintf (&message, "%s in file '%s' at line %d", _(msgid),
> where->lb->file->filename, line);
> }
> else
> ! asprintf (&message, "%s in file '%s' around line %d", _(msgid),
> gfc_source_file, input_line + 1);
>
> tmp = gfc_build_addr_expr (pchar_type_node, gfc_build_cstring_const(message));
>
:addpatch fortran: