This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Remove extra warnings when already warning for CE
- From: Geert Bosch <bosch at darwin dot gnat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Dec 2001 20:06:43 -0500 (EST)
- Subject: [Ada] Remove extra warnings when already warning for CE
2001-12-04 Robert Dewar <dewar@gnat.com>
* exp_util.adb: Minor reformatting from last change
* errout.adb (Check_For_Warning): For a Raised_Constraint_Error node
which is a rewriting of an expression, traverse the original
expression to remove warnings that may have been posted on it.
*** exp_util.adb 2001/10/09 12:41:22 1.333
--- exp_util.adb 2001/10/10 15:31:01 1.334
***************
*** 2503,2511 ****
-- choose to pack the rest of the record. Lead to less efficient code,
-- but safer vis-a-vis of back-end choices.
function In_Partially_Packed_Record (Comp : Entity_Id) return Boolean is
! Rec_Type : constant Entity_Id := Scope (Comp);
Prev_Comp : Entity_Id;
begin
Prev_Comp := First_Entity (Rec_Type);
while Present (Prev_Comp) loop
--- 2503,2516 ----
-- choose to pack the rest of the record. Lead to less efficient code,
-- but safer vis-a-vis of back-end choices.
+ -----------------------------
+ -- Partially_Packed_Record --
+ -----------------------------
+
function In_Partially_Packed_Record (Comp : Entity_Id) return Boolean is
! Rec_Type : constant Entity_Id := Scope (Comp);
Prev_Comp : Entity_Id;
+
begin
Prev_Comp := First_Entity (Rec_Type);
while Present (Prev_Comp) loop
***************
*** 2521,2526 ****
--- 2526,2534 ----
return False;
end In_Partially_Packed_Record;
+
+ -- Start of processing for Must_Be_Aligned
+
begin
-- If object is strictly aligned, we can quit now
*** errout.adb 2001/09/22 14:45:59 1.208
--- errout.adb 2001/10/12 16:26:21 1.209
***************
*** 1981,1987 ****
E := Errors.Table (E).Next;
end loop;
! return OK;
end Check_For_Warning;
-- Start of processing for Remove_Warning_Messages
--- 1981,2010 ----
E := Errors.Table (E).Next;
end loop;
! if Nkind (N) = N_Raise_Constraint_Error
! and then Original_Node (N) /= N
! then
!
! -- Warnings may have been posted on subexpressions of
! -- the original tree. We temporarily replace the raise
! -- statement with the original expression to remove
! -- those warnings, whose sloc do not match those of
! -- any node in the current tree.
!
! declare
! Old : Node_Id := N;
! Status : Traverse_Result;
!
! begin
! Rewrite (N, Original_Node (N));
! Status := Check_For_Warning (N);
! Rewrite (N, Old);
! return Status;
! end;
!
! else
! return OK;
! end if;
end Check_For_Warning;
-- Start of processing for Remove_Warning_Messages