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> 2014-01-22 Jerome Guitton <guitton@adacore.com>
* mlib-tgt-specific-vxworks.adb (Get_Target_Suffix): Replace xscale by * mlib-tgt-specific-vxworks.adb (Get_Target_Suffix): Replace xscale by
......
...@@ -5339,6 +5339,22 @@ an explicit @option{-gnatws} or ...@@ -5339,6 +5339,22 @@ an explicit @option{-gnatws} or
implicit @option{-gnatwe} that is activated by the implicit @option{-gnatwe} that is activated by the
use of @option{-gnatg}. 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 @item -gnatwo
@emph{Activate warnings on address clause overlays.} @emph{Activate warnings on address clause overlays.}
@cindex @option{-gnatwo} (@command{gcc}) @cindex @option{-gnatwo} (@command{gcc})
...@@ -2823,6 +2823,8 @@ package body Sem_Prag is ...@@ -2823,6 +2823,8 @@ package body Sem_Prag is
-- Check if a rep item of the same name as the current pragma is already -- 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 -- 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. -- 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); procedure Check_Duplicated_Export_Name (Nam : Node_Id);
-- Nam is an N_String_Literal node containing the external name set by -- Nam is an N_String_Literal node containing the external name set by
...@@ -3924,6 +3926,36 @@ package body Sem_Prag is ...@@ -3924,6 +3926,36 @@ package body Sem_Prag is
P := Get_Rep_Item (E, Pragma_Name (N), Check_Parents => False); P := Get_Rep_Item (E, Pragma_Name (N), Check_Parents => False);
if Present (P) then 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_Name_1 := Pragma_Name (N);
Error_Msg_Sloc := Sloc (P); Error_Msg_Sloc := Sloc (P);
......
...@@ -2130,11 +2130,18 @@ package body Sem_Warn is ...@@ -2130,11 +2130,18 @@ package body Sem_Warn is
Nam := First (Names (N)); Nam := First (Names (N));
while Present (Nam) loop while Present (Nam) loop
if Entity (Nam) = Pack then if Entity (Nam) = Pack then
Error_Msg_Qual_Level := 1;
Error_Msg_NE -- CODEFIX -- Suppress message if any serious errors detected
("?u?no entities of package& are referenced!", -- that turn off expansion, and thus result in false
Nam, Pack); -- positives for this warning.
Error_Msg_Qual_Level := 0;
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; end if;
Next (Nam); Next (Nam);
...@@ -2402,8 +2409,13 @@ package body Sem_Warn is ...@@ -2402,8 +2409,13 @@ package body Sem_Warn is
-- Else give the warning -- Else give the warning
else else
if not -- Warn if we unreferenced flag set and we have
Has_Unreferenced (Entity (Name (Item))) -- 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 then
Error_Msg_N -- CODEFIX Error_Msg_N -- CODEFIX
("?u?no entities of & are referenced!", ("?u?no entities of & are referenced!",
...@@ -2541,6 +2553,8 @@ package body Sem_Warn is ...@@ -2541,6 +2553,8 @@ package body Sem_Warn is
-- Start of processing for Check_Unused_Withs -- Start of processing for Check_Unused_Withs
begin begin
-- Immediate return if no semantics or warning flag not set
if not Opt.Check_Withs or else Operating_Mode = Check_Syntax then if not Opt.Check_Withs or else Operating_Mode = Check_Syntax then
return; return;
end if; end if;
......
...@@ -160,17 +160,25 @@ gcc -c ^ GNAT COMPILE ...@@ -160,17 +160,25 @@ gcc -c ^ GNAT COMPILE
-gnatw.H ^ /WARNINGS=NOAVOIDGAPS -gnatw.H ^ /WARNINGS=NOAVOIDGAPS
-gnatwi ^ /WARNINGS=IMPLEMENTATION -gnatwi ^ /WARNINGS=IMPLEMENTATION
-gnatwI ^ /WARNINGS=NOIMPLEMENTATION -gnatwI ^ /WARNINGS=NOIMPLEMENTATION
-gnatw.i ^ /WARNINGS=OVERLAPPING_ACTUALS
-gnatw.I ^ /WARNINGS=NOOVERLAPPING_ACTUALS
-gnatwj ^ /WARNINGS=OBSOLESCENT -gnatwj ^ /WARNINGS=OBSOLESCENT
-gnatwJ ^ /WARNINGS=NOOBSOLESCENT -gnatwJ ^ /WARNINGS=NOOBSOLESCENT
-gnatwk ^ /WARNINGS=CONSTANT_VARIABLES -gnatwk ^ /WARNINGS=CONSTANT_VARIABLES
-gnatwK ^ /WARNINGS=NOCONSTANT_VARIABLES -gnatwK ^ /WARNINGS=NOCONSTANT_VARIABLES
-gnatw.k ^ /WARNINGS=STANDARD_REDEFINITION
-gnatw.K ^ /WARNINGS=NOSTANDARD_REDEFINITION
-gnatwl ^ /WARNINGS=ELABORATION -gnatwl ^ /WARNINGS=ELABORATION
-gnatwL ^ /WARNINGS=NOELABORATION -gnatwL ^ /WARNINGS=NOELABORATION
-gnatwl ^ /WARNINGS=INHERITED_ASPECTS
-gnatwL ^ /WARNINGS=NOINHERITED_ASPECTS
-gnatwm ^ /WARNINGS=MODIFIED_UNREF -gnatwm ^ /WARNINGS=MODIFIED_UNREF
-gnatwM ^ /WARNINGS=NOMODIFIED_UNREF -gnatwM ^ /WARNINGS=NOMODIFIED_UNREF
-gnatw.m ^ /WARNINGS=SUSPICIOUS_MODULUES -gnatw.m ^ /WARNINGS=SUSPICIOUS_MODULUES
-gnatw.M ^ /WARNINGS=NOSUSPICIOUS_MODULUES -gnatw.M ^ /WARNINGS=NOSUSPICIOUS_MODULUES
-gnatwn ^ /WARNINGS=NORMAL -gnatwn ^ /WARNINGS=NORMAL
-gnatw.n ^ /WARNINGS=ATOMIC_SYNCHRONIZATION
-gnatw.N ^ /WARNINGS=NOATOMIC_SYNCHRONIZATION
-gnatwo ^ /WARNINGS=OVERLAYS -gnatwo ^ /WARNINGS=OVERLAYS
-gnatwO ^ /WARNINGS=NOOVERLAYS -gnatwO ^ /WARNINGS=NOOVERLAYS
-gnatw.o ^ /WARNINGS=OUT_PARAM_UNREF -gnatw.o ^ /WARNINGS=OUT_PARAM_UNREF
...@@ -188,14 +196,20 @@ gcc -c ^ GNAT COMPILE ...@@ -188,14 +196,20 @@ gcc -c ^ GNAT COMPILE
-gnatwr ^ /WARNINGS=REDUNDANT -gnatwr ^ /WARNINGS=REDUNDANT
-gnatwR ^ /WARNINGS=NOREDUNDANT -gnatwR ^ /WARNINGS=NOREDUNDANT
-gnatws ^ /WARNINGS=SUPPRESS -gnatws ^ /WARNINGS=SUPPRESS
-gnatw.s ^ /WARNINGS=OVERRIDING_SIZE
-gnatw.S ^ /WARNINGS=NOOVERRIDING_SIZE
-gnatwt ^ /WARNINGS=DELETED_CODE -gnatwt ^ /WARNINGS=DELETED_CODE
-gnatwT ^ /WARNINGS=NODELETED_CODE -gnatwT ^ /WARNINGS=NODELETED_CODE
-gnatw.t ^ /WARNINGS=SUSPICIOUS_CONTRACT
-gnatw.T ^ /WARNINGS=NOSUSPICIOUS_CONTRACT
-gnatwu ^ /WARNINGS=UNUSED -gnatwu ^ /WARNINGS=UNUSED
-gnatwU ^ /WARNINGS=NOUNUSED -gnatwU ^ /WARNINGS=NOUNUSED
-gnatw.u ^ /WARNINGS=UNORDERED_ENUMERATIONS -gnatw.u ^ /WARNINGS=UNORDERED_ENUMERATIONS
-gnatw.U ^ /WARNINGS=NOUNORDERED_ENUMERATIONS -gnatw.U ^ /WARNINGS=NOUNORDERED_ENUMERATIONS
-gnatwv ^ /WARNINGS=VARIABLES_UNINITIALIZED -gnatwv ^ /WARNINGS=VARIABLES_UNINITIALIZED
-gnatwV ^ /WARNINGS=NOVARIABLES_UNINITIALIZED -gnatwV ^ /WARNINGS=NOVARIABLES_UNINITIALIZED
-gnatw.v ^ /WARNINGS=REVERSE_BIT_ORDER
-gnatw.V ^ /WARNINGS=NOREVERSE_BIT_ORDER
-gnatww ^ /WARNINGS=LOWBOUND_ASSUMED -gnatww ^ /WARNINGS=LOWBOUND_ASSUMED
-gnatwW ^ /WARNINGS=NOLOWBOUND_ASSUMED -gnatwW ^ /WARNINGS=NOLOWBOUND_ASSUMED
-gnatw.w ^ /WARNINGS=WARNINGS_OFF_PRAGMAS -gnatw.w ^ /WARNINGS=WARNINGS_OFF_PRAGMAS
...@@ -204,8 +218,8 @@ gcc -c ^ GNAT COMPILE ...@@ -204,8 +218,8 @@ gcc -c ^ GNAT COMPILE
-gnatwX ^ /WARNINGS=NOIMPORT_EXPORT_PRAGMAS -gnatwX ^ /WARNINGS=NOIMPORT_EXPORT_PRAGMAS
-gnatw.x ^ /WARNINGS=LOCAL_RAISE_HANDLING -gnatw.x ^ /WARNINGS=LOCAL_RAISE_HANDLING
-gnatw.X ^ /WARNINGS=NOLOCAL_RAISE_HANDLING -gnatw.X ^ /WARNINGS=NOLOCAL_RAISE_HANDLING
-gnatwy ^ /WARNINGS=ADA_2005_COMPATIBILITY -gnatwy ^ /WARNINGS=ADA_COMPATIBILITY
-gnatwY ^ /WARNINGS=NOADA_2005_COMPATIBILITY -gnatwY ^ /WARNINGS=NOADA_COMPATIBILITY
-gnatw.y ^ /WARNINGS=WHY_SPEC_NEEDS_BODY -gnatw.y ^ /WARNINGS=WHY_SPEC_NEEDS_BODY
-gnatw.Y ^ /WARNINGS=NOWHY_SPEC_NEEDS_BODY -gnatw.Y ^ /WARNINGS=NOWHY_SPEC_NEEDS_BODY
-gnatwz ^ /WARNINGS=UNCHECKED_CONVERSIONS -gnatwz ^ /WARNINGS=UNCHECKED_CONVERSIONS
...@@ -250,3 +264,4 @@ stderr ^ SYS$ERROR ...@@ -250,3 +264,4 @@ stderr ^ SYS$ERROR
-H32 ^ /32_MALLOC -H32 ^ /32_MALLOC
-H64 ^ /64_MALLOC -H64 ^ /64_MALLOC
-Wall ^ /WARNINGS=ALL_GCC -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