Commit 9a18e785 by Robert Dewar Committed by Arnaud Charlet

sem_warn.ads, [...] (Warnings_Off_Pragmas): New table

2008-03-26  Robert Dewar  <dewar@adacore.com>

	* sem_warn.ads, sem_warn.adb (Warnings_Off_Pragmas): New table
	(Initialize): New procedure
	(Output_Warnings_Off_Warnings): New procedure
	(Check_References): Suppress certain msgs if Is_Trivial_Subprogram
	(Output_Non_Modifed_In_Out_Warnings): Ditto
	(Warn_On_Unreferenced_Entity): Ditto

From-SVN: r133580
parent 26570b21
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1999-2007, Free Software Foundation, Inc. -- -- Copyright (C) 1999-2008, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -27,14 +27,44 @@ ...@@ -27,14 +27,44 @@
-- about uses of uninitialized variables and unused with's. It also has -- about uses of uninitialized variables and unused with's. It also has
-- some unrelated routines related to the generation of warnings. -- some unrelated routines related to the generation of warnings.
with Alloc; use Alloc;
with Table;
with Types; use Types; with Types; use Types;
package Sem_Warn is package Sem_Warn is
------------------------
-- Warnings Off Table --
------------------------
type Warnings_Off_Entry is record
N : Node_Id;
-- A pragma Warnings (Off, ent) node
E : Entity_Id;
-- The entity involved
end record;
-- An entry is made in the following table for any valid Pragma Warnings
-- (Off, entity) encountered while Opt.Warn_On_Warnings_Off is True. It
-- is used to generate warnings on any of these pragmas that turn out not
-- to be needed, or that could be replaced by Unmodified/Unreferenced.
package Warnings_Off_Pragmas is new Table.Table (
Table_Component_Type => Warnings_Off_Entry,
Table_Index_Type => Int,
Table_Low_Bound => 0,
Table_Initial => Alloc.Warnings_Off_Pragmas_Initial,
Table_Increment => Alloc.Warnings_Off_Pragmas_Increment,
Table_Name => "Name_Warnings_Off_Pragmas");
-------------------- --------------------
-- Initialization -- -- Initialization --
-------------------- --------------------
procedure Initialize;
-- Initialize this package for new compilation
function Set_Warning_Switch (C : Character) return Boolean; function Set_Warning_Switch (C : Character) return Boolean;
-- This function sets the warning switch or switches corresponding to the -- This function sets the warning switch or switches corresponding to the
-- given character. It is used to process a -gnatw switch on the command -- given character. It is used to process a -gnatw switch on the command
...@@ -121,6 +151,12 @@ package Sem_Warn is ...@@ -121,6 +151,12 @@ package Sem_Warn is
-- the compilation process (see Check_Unset_Reference for further -- the compilation process (see Check_Unset_Reference for further
-- details). This procedure outputs waiting warnings, if any. -- details). This procedure outputs waiting warnings, if any.
procedure Output_Unused_Warnings_Off_Warnings;
-- Warnings about pragma Warnings (Off, ent) statements that are unused,
-- or could be replaced by Unmodified/Unreferenced pragmas, are collected
-- till the end of the compilation process. This procedure outputs waiting
-- warnings if any.
---------------------------- ----------------------------
-- Other Warning Routines -- -- Other Warning Routines --
---------------------------- ----------------------------
......
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