From 4f832383ce910fcf2a4c002f0a28cdd2681cb8b5 Mon Sep 17 00:00:00 2001 From: charlet Date: Fri, 4 Nov 2011 11:00:33 +0000 Subject: [PATCH] 2011-11-04 Robert Dewar * sem_prag.adb: Minor reformatting. * gnat_rm.texi: Update documentation for pragma Warnings (Off, "***") usage. * exp_ch2.adb (Expand_Entity_Reference): Only set Atomic_Sync_Required on entities that are variables. Doesn't make any sense on anything else. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180939 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/ChangeLog | 9 +++++++++ gcc/ada/exp_ch2.adb | 1 + gcc/ada/gnat_rm.texi | 11 +++++++++-- gcc/ada/sem_prag.adb | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 0d298e5bf3e..fc3e12bc94b 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,14 @@ 2011-11-04 Robert Dewar + * sem_prag.adb: Minor reformatting. + * gnat_rm.texi: Update documentation for pragma Warnings (Off, + "***") usage. + * exp_ch2.adb (Expand_Entity_Reference): Only set + Atomic_Sync_Required on entities that are variables. Doesn't + make any sense on anything else. + +2011-11-04 Robert Dewar + * exp_ch2.adb (Expand_Entity_Reference): Extend handling of atomic sync to type case. * sem_prag.adb (Process_Suppress_Unsuppress): Atomic Sync can diff --git a/gcc/ada/exp_ch2.adb b/gcc/ada/exp_ch2.adb index 24f47a7775b..a1337aa725d 100644 --- a/gcc/ada/exp_ch2.adb +++ b/gcc/ada/exp_ch2.adb @@ -402,6 +402,7 @@ package body Exp_Ch2 is -- Set Atomic_Sync_Required if necessary for atomic variable if Nkind_In (N, N_Identifier, N_Expanded_Name) + and then Ekind (E) = E_Variable and then (Is_Atomic (E) or else Is_Atomic (Etype (E))) then declare diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 513bca20642..170a9128dd7 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -5575,7 +5575,7 @@ as possibly modified by compiler switches. Then each pragma Warning modifies this set of warnings as specified. This form of the pragma may also be used as a configuration pragma. -The fourth form, with an On|Off parameter and a string, is used to +The fourth form, with an @code{On|Off} parameter and a string, is used to control individual messages, based on their text. The string argument is a pattern that is used to match against the text of individual warning messages (not including the initial "warning: " tag). @@ -5587,7 +5587,7 @@ message @code{warning: 960 bits of "a" unused}. No other regular expression notations are permitted. All characters other than asterisk in these three specific cases are treated as literal characters in the match. -There are two ways to use this pragma. The OFF form can be used as a +There are two ways to use the pragma in this form. The OFF form can be used as a configuration pragma. The effect is to suppress all warnings (if any) that match the pattern string throughout the compilation. @@ -5604,6 +5604,13 @@ pragma Warnings (On, Pattern); In this usage, the pattern string must match in the Off and On pragmas, and at least one matching warning must be suppressed. +Note: to write a string that will match any warning, use the string +@code{"***"}. It will not work to use a single asterisk or two asterisks +since this looks like an operator name. This form with three asterisks +is similar in effect to specifying @code{pragma Warnings (Off)} except that a +matching @code{pragma Warnings (On, "***")} will be required. This can be +helpful in avoiding forgetting to turn warnings back on. + Note: the debug flag -gnatd.i (@code{/NOWARNINGS_PRAGMAS} in VMS) can be used to cause the compiler to entirely ignore all WARNINGS pragmas. This can be useful in checking whether obsolete pragmas in existing programs are hiding diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index e1bf31be23a..e4c02d5adc4 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -14395,7 +14395,7 @@ package body Sem_Prag is -- actual is a conversion. Retrieve the real entity name. if (In_Instance_Body - or else In_Inlined_Body) + or else In_Inlined_Body) and then Nkind (E_Id) = N_Unchecked_Type_Conversion then E_Id := Expression (E_Id); -- 2.11.0