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]

[Ada] Fix casing of identifiers in error messages


There are many cases in which we could give the casing from
the actual source program in an error message and instead we
give default casing, this is due to a one-token error in errout.

Here is an example (compiled with -gnatj60)

> Compiling: bad_casing.adb
>
>      1. package body Bad_Casing is
>      2.   procedure yy_Traverse_BU( yyt: access yy0_Environ ) is
>      3.     begin
>      4.       if (yyt = No_Ident_Table) then return; end if;
>                       |
>         >>> invalid operand types for operator "=", left
>             operand has type access to "yy0_Environ"
>             defined at bad_casing.ads:7, right operand has
>             type "Ident_Table" defined at bad_casing.ads:3
>
>      5.     end yy_Traverse_BU;
>      6. end Bad_Casing;
>
> Compiling: bad_casing.ads
>
>      1. package Bad_Casing is
>      2.   type yyt_Node is abstract tagged null record;
>      3.   type Ident_Table is access all yyt_Node'Class;
>      4.   procedure yy_Traverse_BU ( yyt: access yyt_Node ) is abstract;
>      5.   No_Ident_Table: constant Ident_Table := null;
>      6.   type yy0_Environ is new yyt_Node with null record;
>      7.   procedure yy_Traverse_BU (yyt:access yy0_Environ );
>      8. end Bad_Casing;

Prior to this patch we had Yy0_Environ rather than yy0_Environ in
the error message, we prefer the latter since it is the way the
programmer spelled it in the source.
Yy0_Environ

Tested on x86_64-pc-linux-gnu, committed on trunk

2010-06-22  Robert Dewar  <dewar@adacore.com>

	* errout.adb (Set_Msg_Node): Fix incorrect reference to node.

Attachment: difs
Description: Text document


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