From 84731ab27520db983de312b8c3f4e2b98f3bb8c9 Mon Sep 17 00:00:00 2001 From: charlet Date: Tue, 15 Nov 2005 14:04:22 +0000 Subject: 2005-11-14 Ed Schonberg Robert Dewar * sem_warn.ads, sem_warn.adb (Publicly_Referenceable): Generic formals of a generic subprogram are not visible outside the body. (Set_Warning_Switch): New procedure (code to set warning mode moved here from Switch.C so that it can be shared by pragma processing. (Check_References): Special case warning for non-modified non-imported volatile objects. * par-prag.adb: Modify processing of pragma Warnings to accomodate new form with a string literal argument git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107008 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/par-prag.adb | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'gcc/ada/par-prag.adb') diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb index 097ddd0caf3..5c87fa92a3b 100644 --- a/gcc/ada/par-prag.adb +++ b/gcc/ada/par-prag.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- 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- -- @@ -233,7 +233,7 @@ function Prag (Pragma_Node : Node_Id; Semi : Source_Ptr) return Node_Id is elsif Id = Name_No_Dependence then Set_Restriction_No_Dependence (Unit => Expr, - Warn => Prag_Id = Pragma_Restriction_Warnings); + Warn => Prag_Id = Pragma_Restriction_Warnings); end if; Next (Arg); @@ -963,22 +963,28 @@ begin --------------------- -- pragma Warnings (On | Off, [LOCAL_NAME]) + -- pragma Warnings (static_string_EXPRESSION); - -- The one argument case is processed by the parser, since it may - -- control parser warnings as well as semantic warnings, and in any - -- case we want to be absolutely sure that the range in the warnings - -- table is set well before any semantic analysis is performed. + -- The one argument ON/OFF case is processed by the parser, since it may + -- control parser warnings as well as semantic warnings, and in any case + -- we want to be absolutely sure that the range in the warnings table is + -- set well before any semantic analysis is performed. when Pragma_Warnings => if Arg_Count = 1 then Check_No_Identifier (Arg1); - Check_Arg_Is_On_Or_Off (Arg1); - if Chars (Expression (Arg1)) = Name_On then - Set_Warnings_Mode_On (Pragma_Sloc); - else - Set_Warnings_Mode_Off (Pragma_Sloc); - end if; + declare + Argx : constant Node_Id := Expression (Arg1); + begin + if Nkind (Argx) = N_Identifier then + if Chars (Argx) = Name_On then + Set_Warnings_Mode_On (Pragma_Sloc); + elsif Chars (Argx) = Name_Off then + Set_Warnings_Mode_Off (Pragma_Sloc); + end if; + end if; + end; end if; ----------------------- -- cgit v1.2.1