summaryrefslogtreecommitdiffstats
path: root/gcc/ada/par-prag.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 14:04:22 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 14:04:22 +0000
commit84731ab27520db983de312b8c3f4e2b98f3bb8c9 (patch)
treee8e70b5e8261c96dee5b03868e6dd377cf4c8a98 /gcc/ada/par-prag.adb
parentdb7cfe95d3e2c4de6407c93f4bf8ec2b38bd194a (diff)
downloadppe42-gcc-84731ab27520db983de312b8c3f4e2b98f3bb8c9.tar.gz
ppe42-gcc-84731ab27520db983de312b8c3f4e2b98f3bb8c9.zip
2005-11-14 Ed Schonberg <schonberg@adacore.com>
Robert Dewar <dewar@adacore.com> * 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
Diffstat (limited to 'gcc/ada/par-prag.adb')
-rw-r--r--gcc/ada/par-prag.adb30
1 files changed, 18 insertions, 12 deletions
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;
-----------------------
OpenPOWER on IntegriCloud