Commit 880dabb5 by Arnaud Charlet

[multiple changes]

2010-10-26  Robert Dewar  <dewar@adacore.com>

	* opt.ads: Comment fix.
	* sem_cat.adb: Treat categorization errors as warnings in GNAT Mode.
	* switch-c.adb: GNAT Mode does not set
	Treat_Categorization_Errors_As_Warnings.

2010-10-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch8.adb (Analyze_Subprogram_Renaming): Improve warning when an
	operator renames another one with a different name.

2010-10-26  Thomas Quinot  <quinot@adacore.com>

	* exp_ch4.adb, exp_pakd.adb: Minor reformatting.

From-SVN: r165956
parent 39231404
2010-10-26 Robert Dewar <dewar@adacore.com>
* opt.ads: Comment fix.
* sem_cat.adb: Treat categorization errors as warnings in GNAT Mode.
* switch-c.adb: GNAT Mode does not set
Treat_Categorization_Errors_As_Warnings.
2010-10-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch8.adb (Analyze_Subprogram_Renaming): Improve warning when an
operator renames another one with a different name.
2010-10-26 Thomas Quinot <quinot@adacore.com>
* exp_ch4.adb, exp_pakd.adb: Minor reformatting.
2010-10-26 Bob Duff <duff@adacore.com> 2010-10-26 Bob Duff <duff@adacore.com>
* namet.adb: Improve hash function. * namet.adb: Improve hash function.
......
...@@ -6987,8 +6987,8 @@ package body Exp_Ch4 is ...@@ -6987,8 +6987,8 @@ package body Exp_Ch4 is
return; return;
end if; end if;
-- For the VMS "not" on signed integer types, use conversion to and -- For the VMS "not" on signed integer types, use conversion to and from
-- from a predefined modular type. -- a predefined modular type.
if Is_VMS_Operator (Entity (N)) then if Is_VMS_Operator (Entity (N)) then
declare declare
......
...@@ -67,23 +67,22 @@ package body Exp_Pakd is ...@@ -67,23 +67,22 @@ package body Exp_Pakd is
-- For big-endian machines, element zero is at the left hand end -- For big-endian machines, element zero is at the left hand end
-- (high order end) of a bit field. -- (high order end) of a bit field.
-- The shifts that are used to right justify a field therefore differ -- The shifts that are used to right justify a field therefore differ in
-- in the two cases. For the little-endian case, we can simply use the -- the two cases. For the little-endian case, we can simply use the bit
-- bit number (i.e. the element number * element size) as the count for -- number (i.e. the element number * element size) as the count for a right
-- a right shift. For the big-endian case, we have to subtract the shift -- shift. For the big-endian case, we have to subtract the shift count from
-- count from an appropriate constant to use in the right shift. We use -- an appropriate constant to use in the right shift. We use rotates
-- rotates instead of shifts (which is necessary in the store case to -- instead of shifts (which is necessary in the store case to preserve
-- preserve other fields), and we expect that the backend will be able -- other fields), and we expect that the backend will be able to change the
-- to change the right rotate into a left rotate, avoiding the subtract, -- right rotate into a left rotate, avoiding the subtract, if the machine
-- if the architecture provides such an instruction. -- architecture provides such an instruction.
---------------------------------------------- ----------------------------------------------
-- Entity Tables for Packed Access Routines -- -- Entity Tables for Packed Access Routines --
---------------------------------------------- ----------------------------------------------
-- For the cases of component size = 3,5-7,9-15,17-31,33-63 we call -- For the cases of component size = 3,5-7,9-15,17-31,33-63 we call library
-- library routines. This table is used to obtain the entity for the -- routines. This table provides the entity for the proper routine.
-- proper routine.
type E_Array is array (Int range 01 .. 63) of RE_Id; type E_Array is array (Int range 01 .. 63) of RE_Id;
...@@ -157,10 +156,10 @@ package body Exp_Pakd is ...@@ -157,10 +156,10 @@ package body Exp_Pakd is
62 => RE_Bits_62, 62 => RE_Bits_62,
63 => RE_Bits_63); 63 => RE_Bits_63);
-- Array of Get routine entities. These are used to obtain an element -- Array of Get routine entities. These are used to obtain an element from
-- from a packed array. The N'th entry is used to obtain elements from -- a packed array. The N'th entry is used to obtain elements from a packed
-- a packed array whose component size is N. RE_Null is used as a null -- array whose component size is N. RE_Null is used as a null entry, for
-- entry, for the cases where a library routine is not used. -- the cases where a library routine is not used.
Get_Id : constant E_Array := Get_Id : constant E_Array :=
(01 => RE_Null, (01 => RE_Null,
...@@ -228,9 +227,9 @@ package body Exp_Pakd is ...@@ -228,9 +227,9 @@ package body Exp_Pakd is
63 => RE_Get_63); 63 => RE_Get_63);
-- Array of Get routine entities to be used in the case where the packed -- Array of Get routine entities to be used in the case where the packed
-- array is itself a component of a packed structure, and therefore may -- array is itself a component of a packed structure, and therefore may not
-- not be fully aligned. This only affects the even sizes, since for the -- be fully aligned. This only affects the even sizes, since for the odd
-- odd sizes, we do not get any fixed alignment in any case. -- sizes, we do not get any fixed alignment in any case.
GetU_Id : constant E_Array := GetU_Id : constant E_Array :=
(01 => RE_Null, (01 => RE_Null,
...@@ -297,10 +296,10 @@ package body Exp_Pakd is ...@@ -297,10 +296,10 @@ package body Exp_Pakd is
62 => RE_GetU_62, 62 => RE_GetU_62,
63 => RE_Get_63); 63 => RE_Get_63);
-- Array of Set routine entities. These are used to assign an element -- Array of Set routine entities. These are used to assign an element of a
-- of a packed array. The N'th entry is used to assign elements for -- packed array. The N'th entry is used to assign elements for a packed
-- a packed array whose component size is N. RE_Null is used as a null -- array whose component size is N. RE_Null is used as a null entry, for
-- entry, for the cases where a library routine is not used. -- the cases where a library routine is not used.
Set_Id : constant E_Array := Set_Id : constant E_Array :=
(01 => RE_Null, (01 => RE_Null,
...@@ -368,9 +367,9 @@ package body Exp_Pakd is ...@@ -368,9 +367,9 @@ package body Exp_Pakd is
63 => RE_Set_63); 63 => RE_Set_63);
-- Array of Set routine entities to be used in the case where the packed -- Array of Set routine entities to be used in the case where the packed
-- array is itself a component of a packed structure, and therefore may -- array is itself a component of a packed structure, and therefore may not
-- not be fully aligned. This only affects the even sizes, since for the -- be fully aligned. This only affects the even sizes, since for the odd
-- odd sizes, we do not get any fixed alignment in any case. -- sizes, we do not get any fixed alignment in any case.
SetU_Id : constant E_Array := SetU_Id : constant E_Array :=
(01 => RE_Null, (01 => RE_Null,
...@@ -445,10 +444,10 @@ package body Exp_Pakd is ...@@ -445,10 +444,10 @@ package body Exp_Pakd is
(Atyp : Entity_Id; (Atyp : Entity_Id;
N : Node_Id; N : Node_Id;
Subscr : out Node_Id); Subscr : out Node_Id);
-- Given a constrained array type Atyp, and an indexed component node -- Given a constrained array type Atyp, and an indexed component node N
-- N referencing an array object of this type, build an expression of -- referencing an array object of this type, build an expression of type
-- type Standard.Integer representing the zero-based linear subscript -- Standard.Integer representing the zero-based linear subscript value.
-- value. This expression includes any required range checks. -- This expression includes any required range checks.
procedure Convert_To_PAT_Type (Aexp : Node_Id); procedure Convert_To_PAT_Type (Aexp : Node_Id);
-- Given an expression of a packed array type, builds a corresponding -- Given an expression of a packed array type, builds a corresponding
...@@ -1412,9 +1411,9 @@ package body Exp_Pakd is ...@@ -1412,9 +1411,9 @@ package body Exp_Pakd is
-- The statement to be generated is: -- The statement to be generated is:
-- Obj := atyp!((Obj and Mask1) or (shift_left (rhs, shift))) -- Obj := atyp!((Obj and Mask1) or (shift_left (rhs, Shift)))
-- where mask1 is obtained by shifting Cmask left Shift bits -- where Mask1 is obtained by shifting Cmask left Shift bits
-- and then complementing the result. -- and then complementing the result.
-- the "and Mask1" is omitted if rhs is constant and all 1 bits -- the "and Mask1" is omitted if rhs is constant and all 1 bits
...@@ -1447,21 +1446,21 @@ package body Exp_Pakd is ...@@ -1447,21 +1446,21 @@ package body Exp_Pakd is
Rhs_Val_Known := False; Rhs_Val_Known := False;
end if; end if;
-- Some special checks for the case where the right hand value -- Some special checks for the case where the right hand value is
-- is known at compile time. Basically we have to take care of -- known at compile time. Basically we have to take care of the
-- the implicit conversion to the subtype of the component object. -- implicit conversion to the subtype of the component object.
if Rhs_Val_Known then if Rhs_Val_Known then
-- If we have a biased component type then we must manually do -- If we have a biased component type then we must manually do the
-- the biasing, since we are taking responsibility in this case -- biasing, since we are taking responsibility in this case for
-- for constructing the exact bit pattern to be used. -- constructing the exact bit pattern to be used.
if Has_Biased_Representation (Ctyp) then if Has_Biased_Representation (Ctyp) then
Rhs_Val := Rhs_Val - Expr_Rep_Value (Type_Low_Bound (Ctyp)); Rhs_Val := Rhs_Val - Expr_Rep_Value (Type_Low_Bound (Ctyp));
end if; end if;
-- For a negative value, we manually convert the twos complement -- For a negative value, we manually convert the two's complement
-- value to a corresponding unsigned value, so that the proper -- value to a corresponding unsigned value, so that the proper
-- field width is maintained. If we did not do this, we would -- field width is maintained. If we did not do this, we would
-- get too many leading sign bits later on. -- get too many leading sign bits later on.
...@@ -1544,8 +1543,8 @@ package body Exp_Pakd is ...@@ -1544,8 +1543,8 @@ package body Exp_Pakd is
Rhs := Unchecked_Convert_To (RTE (Bits_Id (Csiz)), Rhs); Rhs := Unchecked_Convert_To (RTE (Bits_Id (Csiz)), Rhs);
end if; end if;
-- Set Etype, since it can be referenced before the -- Set Etype, since it can be referenced before the node is
-- node is completely analyzed. -- completely analyzed.
Set_Etype (Rhs, Etyp); Set_Etype (Rhs, Etyp);
...@@ -1999,8 +1998,7 @@ package body Exp_Pakd is ...@@ -1999,8 +1998,7 @@ package body Exp_Pakd is
Set_Parent (Arg, Parent (N)); Set_Parent (Arg, Parent (N));
Analyze_And_Resolve (Arg); Analyze_And_Resolve (Arg);
Rewrite (N, Rewrite (N, RJ_Unchecked_Convert_To (Ctyp, Arg));
RJ_Unchecked_Convert_To (Ctyp, Arg));
-- All other component sizes for non-modular case -- All other component sizes for non-modular case
...@@ -2177,14 +2175,14 @@ package body Exp_Pakd is ...@@ -2177,14 +2175,14 @@ package body Exp_Pakd is
Convert_To_PAT_Type (Opnd); Convert_To_PAT_Type (Opnd);
PAT := Etype (Opnd); PAT := Etype (Opnd);
-- For the case where the packed array type is a modular type, -- For the case where the packed array type is a modular type, "not A"
-- not A expands simply into: -- expands simply into:
-- rtyp!(PAT!(A) xor mask) -- Rtyp!(PAT!(A) xor Mask)
-- where PAT is the packed array type, and mask is a mask of all -- where PAT is the packed array type, Mask is a mask of all 1 bits of
-- one bits of length equal to the size of this packed type and -- length equal to the size of this packed type, and Rtyp is the actual
-- rtyp is the actual subtype of the operand -- actual subtype of the operand.
Lit := Make_Integer_Literal (Loc, 2 ** RM_Size (PAT) - 1); Lit := Make_Integer_Literal (Loc, 2 ** RM_Size (PAT) - 1);
Set_Print_In_Hex (Lit); Set_Print_In_Hex (Lit);
...@@ -2202,12 +2200,12 @@ package body Exp_Pakd is ...@@ -2202,12 +2200,12 @@ package body Exp_Pakd is
-- System.Bit_Ops.Bit_Not -- System.Bit_Ops.Bit_Not
-- (Opnd'Address, -- (Opnd'Address,
-- Typ'Length * Typ'Component_Size; -- Typ'Length * Typ'Component_Size,
-- Result'Address); -- Result'Address);
-- where Opnd is the Packed_Bytes{1,2,4} operand and the second -- where Opnd is the Packed_Bytes{1,2,4} operand and the second argument
-- argument is the length of the operand in bits. Then we replace -- is the length of the operand in bits. We then replace the expression
-- the expression by a reference to Result. -- with a reference to Result.
else else
declare declare
...@@ -2215,7 +2213,6 @@ package body Exp_Pakd is ...@@ -2215,7 +2213,6 @@ package body Exp_Pakd is
begin begin
Insert_Actions (N, New_List ( Insert_Actions (N, New_List (
Make_Object_Declaration (Loc, Make_Object_Declaration (Loc,
Defining_Identifier => Result_Ent, Defining_Identifier => Result_Ent,
Object_Definition => New_Occurrence_Of (Rtyp, Loc)), Object_Definition => New_Occurrence_Of (Rtyp, Loc)),
...@@ -2223,7 +2220,6 @@ package body Exp_Pakd is ...@@ -2223,7 +2220,6 @@ package body Exp_Pakd is
Make_Procedure_Call_Statement (Loc, Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (RTE (RE_Bit_Not), Loc), Name => New_Occurrence_Of (RTE (RE_Bit_Not), Loc),
Parameter_Associations => New_List ( Parameter_Associations => New_List (
Make_Byte_Aligned_Attribute_Reference (Loc, Make_Byte_Aligned_Attribute_Reference (Loc,
Prefix => Opnd, Prefix => Opnd,
Attribute_Name => Name_Address), Attribute_Name => Name_Address),
...@@ -2243,13 +2239,11 @@ package body Exp_Pakd is ...@@ -2243,13 +2239,11 @@ package body Exp_Pakd is
Prefix => New_Occurrence_Of (Result_Ent, Loc), Prefix => New_Occurrence_Of (Result_Ent, Loc),
Attribute_Name => Name_Address))))); Attribute_Name => Name_Address)))));
Rewrite (N, Rewrite (N, New_Occurrence_Of (Result_Ent, Loc));
New_Occurrence_Of (Result_Ent, Loc));
end; end;
end if; end if;
Analyze_And_Resolve (N, Typ, Suppress => All_Checks); Analyze_And_Resolve (N, Typ, Suppress => All_Checks);
end Expand_Packed_Not; end Expand_Packed_Not;
----------------------------- -----------------------------
...@@ -2519,11 +2513,11 @@ package body Exp_Pakd is ...@@ -2519,11 +2513,11 @@ package body Exp_Pakd is
Source_Siz := UI_To_Int (RM_Size (Source_Typ)); Source_Siz := UI_To_Int (RM_Size (Source_Typ));
Target_Siz := UI_To_Int (RM_Size (Target_Typ)); Target_Siz := UI_To_Int (RM_Size (Target_Typ));
-- First step, if the source type is not a discrete type, then we -- First step, if the source type is not a discrete type, then we first
-- first convert to a modular type of the source length, since -- convert to a modular type of the source length, since otherwise, on
-- otherwise, on a big-endian machine, we get left-justification. -- a big-endian machine, we get left-justification. We do it for little-
-- We do it for little-endian machines as well, because there might -- endian machines as well, because there might be junk bits that are
-- be junk bits that are not cleared if the type is not numeric. -- not cleared if the type is not numeric.
if Source_Siz /= Target_Siz if Source_Siz /= Target_Siz
and then not Is_Discrete_Type (Source_Typ) and then not Is_Discrete_Type (Source_Typ)
...@@ -2531,15 +2525,15 @@ package body Exp_Pakd is ...@@ -2531,15 +2525,15 @@ package body Exp_Pakd is
Src := Unchecked_Convert_To (RTE (Bits_Id (Source_Siz)), Src); Src := Unchecked_Convert_To (RTE (Bits_Id (Source_Siz)), Src);
end if; end if;
-- In the big endian case, if the lengths of the two types differ, -- In the big endian case, if the lengths of the two types differ, then
-- then we must worry about possible left justification in the -- we must worry about possible left justification in the conversion,
-- conversion, and avoiding that is what this is all about. -- and avoiding that is what this is all about.
if Bytes_Big_Endian and then Source_Siz /= Target_Siz then if Bytes_Big_Endian and then Source_Siz /= Target_Siz then
-- Next step. If the target is not a discrete type, then we first -- Next step. If the target is not a discrete type, then we first
-- convert to a modular type of the target length, since -- convert to a modular type of the target length, since otherwise,
-- otherwise, on a big-endian machine, we get left-justification. -- on a big-endian machine, we get left-justification.
if not Is_Discrete_Type (Target_Typ) then if not Is_Discrete_Type (Target_Typ) then
Src := Unchecked_Convert_To (RTE (Bits_Id (Target_Siz)), Src); Src := Unchecked_Convert_To (RTE (Bits_Id (Target_Siz)), Src);
...@@ -2555,16 +2549,16 @@ package body Exp_Pakd is ...@@ -2555,16 +2549,16 @@ package body Exp_Pakd is
-- Setup_Enumeration_Packed_Array_Reference -- -- Setup_Enumeration_Packed_Array_Reference --
---------------------------------------------- ----------------------------------------------
-- All we have to do here is to find the subscripts that correspond -- All we have to do here is to find the subscripts that correspond to the
-- to the index positions that have non-standard enumeration types -- index positions that have non-standard enumeration types and insert a
-- and insert a Pos attribute to get the proper subscript value. -- Pos attribute to get the proper subscript value.
-- Finally the prefix must be uncheck converted to the corresponding -- Finally the prefix must be uncheck-converted to the corresponding packed
-- packed array type. -- array type.
-- Note that the component type is unchanged, so we do not need to -- Note that the component type is unchanged, so we do not need to fiddle
-- fiddle with the types (Gigi always automatically takes the packed -- with the types (Gigi always automatically takes the packed array type if
-- array type if it is set, as it will be in this case). -- it is set, as it will be in this case).
procedure Setup_Enumeration_Packed_Array_Reference (N : Node_Id) is procedure Setup_Enumeration_Packed_Array_Reference (N : Node_Id) is
Pfx : constant Node_Id := Prefix (N); Pfx : constant Node_Id := Prefix (N);
...@@ -2573,9 +2567,9 @@ package body Exp_Pakd is ...@@ -2573,9 +2567,9 @@ package body Exp_Pakd is
Expr : Node_Id; Expr : Node_Id;
begin begin
-- If the array is unconstrained, then we replace the array -- If the array is unconstrained, then we replace the array reference
-- reference with its actual subtype. This actual subtype will -- with its actual subtype. This actual subtype will have a packed array
-- have a packed array type with appropriate bounds. -- type with appropriate bounds.
if not Is_Constrained (Packed_Array_Type (Etype (Pfx))) then if not Is_Constrained (Packed_Array_Type (Etype (Pfx))) then
Convert_To_Actual_Subtype (Pfx); Convert_To_Actual_Subtype (Pfx);
...@@ -2610,7 +2604,6 @@ package body Exp_Pakd is ...@@ -2610,7 +2604,6 @@ package body Exp_Pakd is
Expressions => Exprs)); Expressions => Exprs));
Analyze_And_Resolve (N, Typ); Analyze_And_Resolve (N, Typ);
end Setup_Enumeration_Packed_Array_Reference; end Setup_Enumeration_Packed_Array_Reference;
----------------------------------------- -----------------------------------------
...@@ -2657,8 +2650,8 @@ package body Exp_Pakd is ...@@ -2657,8 +2650,8 @@ package body Exp_Pakd is
Compute_Linear_Subscript (Atyp, N, Shift); Compute_Linear_Subscript (Atyp, N, Shift);
-- If the component size is not 1, then the subscript must be -- If the component size is not 1, then the subscript must be multiplied
-- multiplied by the component size to get the shift count. -- by the component size to get the shift count.
if Csiz /= 1 then if Csiz /= 1 then
Shift := Shift :=
...@@ -2667,8 +2660,8 @@ package body Exp_Pakd is ...@@ -2667,8 +2660,8 @@ package body Exp_Pakd is
Right_Opnd => Shift); Right_Opnd => Shift);
end if; end if;
-- If we have the array case, then this shift count must be broken -- If we have the array case, then this shift count must be broken down
-- down into a byte subscript, and a shift within the byte. -- into a byte subscript, and a shift within the byte.
if Is_Array_Type (PAT) then if Is_Array_Type (PAT) then
...@@ -2704,9 +2697,9 @@ package body Exp_Pakd is ...@@ -2704,9 +2697,9 @@ package body Exp_Pakd is
Shift := New_Shift; Shift := New_Shift;
end; end;
-- For the modular integer case, the object to be manipulated is -- For the modular integer case, the object to be manipulated is the
-- the entire array, so Obj is unchanged. Note that we will reset -- entire array, so Obj is unchanged. Note that we will reset its type
-- its type to PAT before returning to the caller. -- to PAT before returning to the caller.
else else
null; null;
...@@ -2722,14 +2715,13 @@ package body Exp_Pakd is ...@@ -2722,14 +2715,13 @@ package body Exp_Pakd is
-- Here we have the case of 2-bit fields -- Here we have the case of 2-bit fields
-- For the little-endian case, we already have the proper shift -- For the little-endian case, we already have the proper shift count
-- count set, e.g. for element 2, the shift count is 2*2 = 4. -- set, e.g. for element 2, the shift count is 2*2 = 4.
-- For the big endian case, we have to adjust the shift count, -- For the big endian case, we have to adjust the shift count, computing
-- computing it as (N - F) - shift, where N is the number of bits -- it as (N - F) - Shift, where N is the number of bits in an element of
-- in an element of the array used to implement the packed array, -- the array used to implement the packed array, F is the number of bits
-- F is the number of bits in a source level array element, and -- in a source array element, and Shift is the count so far computed.
-- shift is the count so far computed.
if Bytes_Big_Endian then if Bytes_Big_Endian then
Shift := Shift :=
......
...@@ -1233,7 +1233,7 @@ package Opt is ...@@ -1233,7 +1233,7 @@ package Opt is
Treat_Categorization_Errors_As_Warnings : Boolean := False; Treat_Categorization_Errors_As_Warnings : Boolean := False;
-- Normally categorization errors are true illegalities. If this switch -- Normally categorization errors are true illegalities. If this switch
-- is set, then such errors result in warning messages rather than error -- is set, then such errors result in warning messages rather than error
-- messages. Set True by -gnatg or -gnateP (P for Pure/Preelaborate). -- messages. Set True by -gnateP (P for Pure/Preelaborate).
Treat_Restrictions_As_Warnings : Boolean := False; Treat_Restrictions_As_Warnings : Boolean := False;
-- GNAT -- GNAT
......
...@@ -226,10 +226,19 @@ package body Sem_Cat is ...@@ -226,10 +226,19 @@ package body Sem_Cat is
if Err then if Err then
-- These messages are warnings in GNAT mode or if the -gnateC switch -- These messages are warnings in GNAT mode or if the -gnateP switch
-- was set. Otherwise these are real errors for real illegalities. -- was set. Otherwise these are real errors for real illegalities.
Error_Msg_Warn := Treat_Categorization_Errors_As_Warnings; -- The reason we suppress these errors in GNAT mode is that the run-
-- time has several instances of violations of the categorization
-- errors (e.g. Pure units withing Preelaborate units. All these
-- violations are harmless in the cases where we intend them, and
-- we suppress the warnings with Warnings (Off). In cases where we
-- do not intend the violation, warnings are errors in GNAT mode
-- anyway, so we will still get an error.
Error_Msg_Warn :=
Treat_Categorization_Errors_As_Warnings or GNAT_Mode;
-- Don't give error if main unit is not an internal unit, and the -- Don't give error if main unit is not an internal unit, and the
-- unit generating the message is an internal unit. This is the -- unit generating the message is an internal unit. This is the
......
...@@ -2480,16 +2480,19 @@ package body Sem_Ch8 is ...@@ -2480,16 +2480,19 @@ package body Sem_Ch8 is
-- A useful warning, suggested by Ada Bug Finder (Ada-Europe 2005) -- A useful warning, suggested by Ada Bug Finder (Ada-Europe 2005)
-- is to warn if an operator is being renamed as a different operator. -- is to warn if an operator is being renamed as a different operator.
-- If the operator is predefined, examine the kind of the entity, not
-- the abbreviated declaration in Standard.
if Comes_From_Source (N) if Comes_From_Source (N)
and then Present (Old_S) and then Present (Old_S)
and then Nkind (Old_S) = N_Defining_Operator_Symbol and then
(Nkind (Old_S) = N_Defining_Operator_Symbol
or else Ekind (Old_S) = E_Operator)
and then Nkind (New_S) = N_Defining_Operator_Symbol and then Nkind (New_S) = N_Defining_Operator_Symbol
and then Chars (Old_S) /= Chars (New_S) and then Chars (Old_S) /= Chars (New_S)
then then
Error_Msg_NE Error_Msg_NE
("?& is being renamed as a different operator", ("?& is being renamed as a different operator", N, Old_S);
New_S, Old_S);
end if; end if;
-- Check for renaming of obsolescent subprogram -- Check for renaming of obsolescent subprogram
......
...@@ -567,16 +567,6 @@ package body Switch.C is ...@@ -567,16 +567,6 @@ package body Switch.C is
Set_GNAT_Mode_Warnings; Set_GNAT_Mode_Warnings;
Set_GNAT_Style_Check_Options; Set_GNAT_Style_Check_Options;
-- Suppress categorization errors. The run-time has several
-- instances of violations of the categorization errors (e.g.
-- Pure units withing Preelaborate units. These violations are
-- harmless in the cases where we intend them, and we suppress
-- the warnings with Warnings (Off). In cases where we do not
-- intend the violation, warnings are errors in -gnatg mode
-- anyway, so we will still get an error.
Treat_Categorization_Errors_As_Warnings := True;
-- Processing for G switch -- Processing for G switch
when 'G' => when 'G' =>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment