Commit 1250f802 by Robert Dewar Committed by Arnaud Charlet

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
parent 54533a0b
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.
2014-01-22 Jerome Guitton <guitton@adacore.com>
* mlib-tgt-specific-vxworks.adb (Get_Target_Suffix): Replace xscale by
......
......@@ -5339,6 +5339,22 @@ an explicit @option{-gnatws} or
implicit @option{-gnatwe} that is activated by the
use of @option{-gnatg}.
@item -gnatw.n
@emph{Activate warnings on atomic synchronization.}
@cindex @option{-gnatw.n} (@command{gcc})
@cindex Atomic Synchronization, warnings
This switch actives warnings when an access to an atomic variable
requires the generation of atomic synchronization code. These
warnings are off by default and this warning is not included
in @code{-gnatwa}.
@item -gnatw.N
@emph{Suppress warnings on atomic synchronization.}
@cindex @option{-gnatw.n} (@command{gcc})
@cindex Atomic Synchronization, warnings
This switch suppresses warnings when an access to an atomic variable
requires the generation of atomic synchronization code.
@item -gnatwo
@emph{Activate warnings on address clause overlays.}
@cindex @option{-gnatwo} (@command{gcc})
......@@ -2823,6 +2823,8 @@ package body Sem_Prag is
-- Check if a rep item of the same name as the current pragma is already
-- chained as a rep pragma to the given entity. If so give a message
-- about the duplicate, and then raise Pragma_Exit so does not return.
-- Note that if E is a type, then this routine avoids flagging a pragma
-- which applies to a parent type from which E is derived.
procedure Check_Duplicated_Export_Name (Nam : Node_Id);
-- Nam is an N_String_Literal node containing the external name set by
......@@ -3924,6 +3926,36 @@ package body Sem_Prag is
P := Get_Rep_Item (E, Pragma_Name (N), Check_Parents => False);
if Present (P) then
-- If the entity is a type, then we have to make sure that the
-- ostensible duplicate is not for a parent type from which this
-- type is derived.
if Is_Type (E) then
if Nkind (P) = N_Pragma then
declare
Args : constant List_Id :=
Pragma_Argument_Associations (P);
begin
if Present (Args)
and then Is_Entity_Name (Expression (First (Args)))
and then Is_Type (Entity (Expression (First (Args))))
and then Entity (Expression (First (Args))) /= E
then
return;
end if;
end;
elsif Nkind (P) = N_Aspect_Specification
and then Is_Type (Entity (P))
and then Entity (P) /= E
then
return;
end if;
end if;
-- Here we have a definite duplicate
Error_Msg_Name_1 := Pragma_Name (N);
Error_Msg_Sloc := Sloc (P);
......
......@@ -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;
......
......@@ -160,17 +160,25 @@ gcc -c ^ GNAT COMPILE
-gnatw.H ^ /WARNINGS=NOAVOIDGAPS
-gnatwi ^ /WARNINGS=IMPLEMENTATION
-gnatwI ^ /WARNINGS=NOIMPLEMENTATION
-gnatw.i ^ /WARNINGS=OVERLAPPING_ACTUALS
-gnatw.I ^ /WARNINGS=NOOVERLAPPING_ACTUALS
-gnatwj ^ /WARNINGS=OBSOLESCENT
-gnatwJ ^ /WARNINGS=NOOBSOLESCENT
-gnatwk ^ /WARNINGS=CONSTANT_VARIABLES
-gnatwK ^ /WARNINGS=NOCONSTANT_VARIABLES
-gnatw.k ^ /WARNINGS=STANDARD_REDEFINITION
-gnatw.K ^ /WARNINGS=NOSTANDARD_REDEFINITION
-gnatwl ^ /WARNINGS=ELABORATION
-gnatwL ^ /WARNINGS=NOELABORATION
-gnatwl ^ /WARNINGS=INHERITED_ASPECTS
-gnatwL ^ /WARNINGS=NOINHERITED_ASPECTS
-gnatwm ^ /WARNINGS=MODIFIED_UNREF
-gnatwM ^ /WARNINGS=NOMODIFIED_UNREF
-gnatw.m ^ /WARNINGS=SUSPICIOUS_MODULUES
-gnatw.M ^ /WARNINGS=NOSUSPICIOUS_MODULUES
-gnatwn ^ /WARNINGS=NORMAL
-gnatw.n ^ /WARNINGS=ATOMIC_SYNCHRONIZATION
-gnatw.N ^ /WARNINGS=NOATOMIC_SYNCHRONIZATION
-gnatwo ^ /WARNINGS=OVERLAYS
-gnatwO ^ /WARNINGS=NOOVERLAYS
-gnatw.o ^ /WARNINGS=OUT_PARAM_UNREF
......@@ -188,14 +196,20 @@ gcc -c ^ GNAT COMPILE
-gnatwr ^ /WARNINGS=REDUNDANT
-gnatwR ^ /WARNINGS=NOREDUNDANT
-gnatws ^ /WARNINGS=SUPPRESS
-gnatw.s ^ /WARNINGS=OVERRIDING_SIZE
-gnatw.S ^ /WARNINGS=NOOVERRIDING_SIZE
-gnatwt ^ /WARNINGS=DELETED_CODE
-gnatwT ^ /WARNINGS=NODELETED_CODE
-gnatw.t ^ /WARNINGS=SUSPICIOUS_CONTRACT
-gnatw.T ^ /WARNINGS=NOSUSPICIOUS_CONTRACT
-gnatwu ^ /WARNINGS=UNUSED
-gnatwU ^ /WARNINGS=NOUNUSED
-gnatw.u ^ /WARNINGS=UNORDERED_ENUMERATIONS
-gnatw.U ^ /WARNINGS=NOUNORDERED_ENUMERATIONS
-gnatwv ^ /WARNINGS=VARIABLES_UNINITIALIZED
-gnatwV ^ /WARNINGS=NOVARIABLES_UNINITIALIZED
-gnatw.v ^ /WARNINGS=REVERSE_BIT_ORDER
-gnatw.V ^ /WARNINGS=NOREVERSE_BIT_ORDER
-gnatww ^ /WARNINGS=LOWBOUND_ASSUMED
-gnatwW ^ /WARNINGS=NOLOWBOUND_ASSUMED
-gnatw.w ^ /WARNINGS=WARNINGS_OFF_PRAGMAS
......@@ -204,8 +218,8 @@ gcc -c ^ GNAT COMPILE
-gnatwX ^ /WARNINGS=NOIMPORT_EXPORT_PRAGMAS
-gnatw.x ^ /WARNINGS=LOCAL_RAISE_HANDLING
-gnatw.X ^ /WARNINGS=NOLOCAL_RAISE_HANDLING
-gnatwy ^ /WARNINGS=ADA_2005_COMPATIBILITY
-gnatwY ^ /WARNINGS=NOADA_2005_COMPATIBILITY
-gnatwy ^ /WARNINGS=ADA_COMPATIBILITY
-gnatwY ^ /WARNINGS=NOADA_COMPATIBILITY
-gnatw.y ^ /WARNINGS=WHY_SPEC_NEEDS_BODY
-gnatw.Y ^ /WARNINGS=NOWHY_SPEC_NEEDS_BODY
-gnatwz ^ /WARNINGS=UNCHECKED_CONVERSIONS
......@@ -250,3 +264,4 @@ stderr ^ SYS$ERROR
-H32 ^ /32_MALLOC
-H64 ^ /64_MALLOC
-Wall ^ /WARNINGS=ALL_GCC
-Wuninitialized ^ /WARNINGS=UNINITIALIZED
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