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: [fortran, patch] Remove parentheses and comma in error message.


* ping *

Tobias Burnus schrieb:
> 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:
> 


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