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
......
...@@ -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