aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_warn.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2014-01-22 11:18:34 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2014-01-22 12:18:34 +0100
commit1250f802690505f7b38517a0f0e9cb9957532010 (patch)
treeed7b39a4ddfe3cd018327d32401f6db2f8221ef5 /gcc/ada/sem_warn.adb
parent54533a0b36101d77e146f1d88e8dfcaad467730a (diff)
downloadgcc-1250f802690505f7b38517a0f0e9cb9957532010.zip
gcc-1250f802690505f7b38517a0f0e9cb9957532010.tar.gz
gcc-1250f802690505f7b38517a0f0e9cb9957532010.tar.bz2
sem_warn.adb (Check_Use_Clause): Don't give no entities used msg if errors found.
2014-01-22 Robert Dewar <dewar@adacore.com> * sem_warn.adb (Check_Use_Clause): Don't give no entities used msg if errors found. (Check_One_Unit): Same change. 2014-01-22 Robert Dewar <dewar@adacore.com> * ug_words: Add missing/wrong entries for VMS warning switches. * sem_prag.adb (Check_Duplicate_Pragma): Avoid flagging parent type. From-SVN: r206920
Diffstat (limited to 'gcc/ada/sem_warn.adb')
-rw-r--r--gcc/ada/sem_warn.adb28
1 files changed, 21 insertions, 7 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 5603464..c2bef7a 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -2130,11 +2130,18 @@ package body Sem_Warn is
Nam := First (Names (N));
while Present (Nam) loop
if Entity (Nam) = Pack then
- Error_Msg_Qual_Level := 1;
- Error_Msg_NE -- CODEFIX
- ("?u?no entities of package& are referenced!",
- Nam, Pack);
- Error_Msg_Qual_Level := 0;
+
+ -- Suppress message if any serious errors detected
+ -- that turn off expansion, and thus result in false
+ -- positives for this warning.
+
+ if Serious_Errors_Detected = 0 then
+ Error_Msg_Qual_Level := 1;
+ Error_Msg_NE -- CODEFIX
+ ("?u?no entities of package& are referenced!",
+ Nam, Pack);
+ Error_Msg_Qual_Level := 0;
+ end if;
end if;
Next (Nam);
@@ -2402,8 +2409,13 @@ package body Sem_Warn is
-- Else give the warning
else
- if not
- Has_Unreferenced (Entity (Name (Item)))
+ -- Warn if we unreferenced flag set and we have
+ -- not had serious errors. The reason we inhibit
+ -- the message if there are errors is to prevent
+ -- false positives from disabling expansion.
+
+ if not Has_Unreferenced (Entity (Name (Item)))
+ and then Serious_Errors_Detected = 0
then
Error_Msg_N -- CODEFIX
("?u?no entities of & are referenced!",
@@ -2541,6 +2553,8 @@ package body Sem_Warn is
-- Start of processing for Check_Unused_Withs
begin
+ -- Immediate return if no semantics or warning flag not set
+
if not Opt.Check_Withs or else Operating_Mode = Check_Syntax then
return;
end if;