in this section for details on optional warning messages that can be
individually controlled. The warnings that are not turned on by this
switch are:
-@option{-gnatwd} (implicit dereferencing),
-@option{-gnatwh} (hiding),
+
+@itemize
+@option{-gnatwd} (implicit dereferencing)
@option{-gnatw.d} (tag warnings with -gnatw switch)
-@option{-gnatw.h} (holes (gaps) in record layouts)
-@option{-gnatw.i} (overlapping actuals),
-@option{-gnatw.k} (redefinition of names in standard),
-@option{-gnatwl} (elaboration warnings),
-@option{-gnatw.l} (inherited aspects),
-@option{-gnatw.o} (warn on values set by out parameters ignored),
+@option{-gnatwh} (hiding)
+@option{-gnatw.h} (holes in record layouts)
+@option{-gnatw.k} (redefinition of names in standard)
+@option{-gnatwl} (elaboration warnings)
+@option{-gnatw.l} (inherited aspects)
+@option{-gnatw.n} (atomic synchronization)
+@option{-gnatwo} (address clause overlay)
+@option{-gnatw.o} (values set by out parameters ignored)
+@option{-gnatw.s} (overridden size clause)
@option{-gnatwt} (tracking of deleted conditional code)
-and @option{-gnatw.u} (unordered enumeration),
+@option{-gnatw.u} (unordered enumeration)
+@option{-gnatw.w} (use of Warnings Off)
+@option{-gnatw.y} (reasons for package needing body)
+@end itemize
+
All other optional warnings are turned on.
@item -gnatwA
majority, but not all, of the components. A warning is given for each
component for which no component clause is present.
-This warning can also be turned on using @option{-gnatwa}.
-
@item -gnatw.C
@emph{Suppress warnings on missing component clauses.}
@cindex @option{-gnatwC} (@command{gcc})
@code{.all} appears in the source code (assuming no warnings are
generated as a result of this switch). The default is that such
warnings are not generated.
-Note that @option{-gnatwa} does not affect the setting of
-this warning option.
@item -gnatwD
@emph{Suppress warnings on implicit dereferencing.}
@cindex Formals, unreferenced
This switch causes a warning to be generated if a formal parameter
is not referenced in the body of the subprogram. This warning can
-also be turned on using @option{-gnatwa} or @option{-gnatwu}. The
+also be turned on using @option{-gnatwu}. The
default is that these warnings are not generated.
@item -gnatwF
@cindex Pragmas, unrecognized
This switch causes a warning to be generated if an unrecognized
pragma is encountered. Apart from issuing this warning, the
-pragma is ignored and has no effect. This warning can
-also be turned on using @option{-gnatwa}. The default
+pragma is ignored and has no effect. The default
is that such warnings are issued (satisfying the Ada Reference
Manual requirement that such warnings appear).
if it is for a non-overloadable entity, and it declares an entity with the
same name as some other entity that is directly or use-visible. The default
is that such warnings are not generated.
-Note that @option{-gnatwa} does not affect the setting of this warning option.
@item -gnatwH
@emph{Suppress warnings on hiding.}
representation clauses that leave holes (gaps) in the record layout.
If this warning option is active, then record representation clauses
should specify a contiguous layout, adding unused fill fields if needed.
-Note that @option{-gnatwa} does not affect the setting of this warning option.
@item -gnatw.H
@emph{Suppress warnings on holes/gaps in records.}
Programmer's Reference Manual. Such units are intended only
for internal implementation purposes and should not be @code{with}'ed
by user programs. The default is that such warnings are generated
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwI
@emph{Disable warnings on implementation units.}
@cindex @option{-gnatw.i} (@command{gcc})
This switch enables a warning on statically detectable overlapping actuals in
a subprogram call, when one of the actuals is an in-out parameter, and the
-types of the actuals are not by-copy types. The warning is off by default,
-and is not included under -gnatwa.
+types of the actuals are not by-copy types. This warning is off by default.
@item -gnatw.I
@emph{Disable warnings on overlapping actuals.}
of the renamed packages (like @code{Text_IO}) and use of package
@code{ASCII} are not flagged, since these are very common and
would generate many annoying positive warnings. The default is that
-such warnings are not generated. This warning is also turned on by
-the use of @option{-gnatwa}.
+such warnings are not generated.
In addition to the above cases, warnings are also generated for
GNAT features that have been provided in past versions but which
This switch activates warnings for variables that are initialized but
never modified, and then could be declared constants. The default is that
such warnings are not given.
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwK
@emph{Suppress warnings on variables that could be constants.}
visible, meaning that use visibiliy on such redeclared names does not
work as expected. Names of discriminants and components in records are
not included in this check.
-This warning is not part of the warnings activated by @option{-gnatwa}.
-It must be explicitly activated.
@item -gnatw.K
@emph{Suppress warnings on variables that could be constants.}
See the section in this guide on elaboration checking for further details.
The default is that such warnings
are not generated.
-This warning is not automatically turned on by the use of @option{-gnatwa}.
@item -gnatwL
@emph{Suppress warnings for elaboration pragmas.}
This switch causes the compiler to list inherited invariants,
preconditions, and postconditions from Type_Invariant'Class, Invariant'Class,
Pre'Class, and Post'Class aspects. Also list inherited subtype predicates.
-These messages are not automatically turned on by the use of @option{-gnatwa}.
@item -gnatw.L
@emph{Suppress listing of inherited aspects.}
whose value is never read. The warning is suppressed for volatile
variables and also for variables that are renamings of other variables
or for which an address clause is given.
-This warning can also be turned on using @option{-gnatwa}.
The default is that these warnings are not given.
@item -gnatwM
@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}.
-
+warnings are off by default.
@item -gnatw.N
@emph{Suppress warnings on atomic synchronization.}
@cindex @option{-gnatw.n} (@command{gcc})
This switch activates warnings for possibly unintended initialization
effects of defining address clauses that cause one variable to overlap
another. The default is that such warnings are generated.
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwO
@emph{Suppress warnings on address clause overlays.}
The warning is suppressed for volatile
variables and also for variables that are renamings of other variables
or for which an address clause is given.
-The default is that these warnings are not given. Note that this warning
-is not included in -gnatwa, it must be activated explicitly.
+The default is that these warnings are not given.
@item -gnatw.O
@emph{Disable warnings on modified but unreferenced out parameters.}
many reasons for not being able to inline a call, including most
commonly that the call is too complex to inline. The default is
that such warnings are not given.
-This warning can also be turned on using @option{-gnatwa}.
Warnings on ineffective inlining by the gcc back-end can be activated
separately, using the gcc switch -Winline.
warning is suppressed if any use of named parameter notation is used,
so this is the appropriate way to suppress a false positive (and
serves to emphasize that the "misordering" is deliberate). The
-default is
-that such warnings are not given.
-This warning can also be turned on using @option{-gnatwa}.
+default is that such warnings are not given.
@item -gnatw.P
@emph{Suppress warnings on parameter ordering.}
follow the rule of always parenthesizing to make the association clear, and
this warning switch warns if such parentheses are not present. The default
is that these warnings are given.
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwQ
@emph{Suppress warnings on questionable missing parentheses.}
Comparison of boolean expressions to an explicit True value.
@end itemize
-This warning can also be turned on using @option{-gnatwa}.
The default is that warnings for redundant constructs are not given.
@item -gnatwR
This switch activates warnings for an object renaming that renames a
function call, which is equivalent to a constant declaration (as
opposed to renaming the function itself). The default is that these
-warnings are given. This warning can also be turned on using
-@option{-gnatwa}.
+warnings are given.
@item -gnatw.R
@emph{Suppress warnings for object renaming function.}
warning is similarly given in the array case if a specified
component size overrides an explicit size clause for the array
component type.
-Note that @option{-gnatwa} does not affect the setting of this warning option.
@item -gnatw.S
@emph{Suppress warnings on overridden size clauses.}
@cindex Deleted code, warnings
This switch activates warnings for tracking of code in conditionals (IF and
CASE statements) that is detected to be dead code which cannot be executed, and
-which is removed by the front end. This warning is off by default, and is not
-turned on by @option{-gnatwa}, it has to be turned on explicitly. This may be
+which is removed by the front end. This warning is off by default. This may be
useful for detecting deactivated code in certified applications.
@item -gnatwT
A procedure postcondition or contract case is suspicious when it only
refers to the pre-state of the procedure, because in that case it should
rather be expressed as a precondition. The default is that such warnings
-are not generated. This warning can also be turned on using @option{-gnatwa}.
+are not generated.
@item -gnatw.T
@emph{Suppress warnings on suspicious contracts.}
such warnings are not generated.
This switch also activates warnings on unreferenced formals
(it includes the effect of @option{-gnatwf}).
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwU
@emph{Suppress warnings on unused entities.}
the description of pragma @code{Ordered} in the
@cite{@value{EDITION} Reference Manual} for further details.
The default is that such warnings are not generated.
-This warning is not automatically turned on by the use of @option{-gnatwa}.
@item -gnatw.U
@emph{Deactivate warnings on unordered enumeration types.}
This switch activates warnings for access to variables which
may not be properly initialized. The default is that
such warnings are generated.
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwV
@emph{Suppress warnings on unassigned variables.}
on records to which a component clause is applied. The effect of specifying
non-default bit ordering is a bit subtle (and changed with Ada 2005), so
these messages, which are given by default, are useful in understanding the
-exact consequences of using this feature. These messages
-can also be turned on using @option{-gnatwa}
+exact consequences of using this feature.
@item -gnatw.V
@emph{Suppress info messages for non-default bit order.}
with a literal or S'Length. This is a case where the code is assuming that the
low bound is one, which is in general not true (for example when a slice is
passed). The default is that such warnings are generated.
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwW
@emph{Suppress warnings on wrong low bound assumption.}
This switch activates warnings for use of @code{pragma Warnings (Off, entity)}
where either the pragma is entirely useless (because it suppresses no
warnings), or it could be replaced by @code{pragma Unreferenced} or
-@code{pragma Unmodified}. The default is that these warnings are not given.
-Note that this warning is not included in -gnatwa, it must be
-activated explicitly. Also activates warnings for the case of
+@code{pragma Unmodified}.
+Also activates warnings for the case of
Warnings (Off, String), where either there is no matching
Warnings (On, String), or the Warnings (Off) did not suppress any warning.
+The default is that these warnings are not given.
@item -gnatw.W
@emph{Suppress warnings on unnecessary Warnings Off pragmas}
because the C compiler cannot supply the proper default, so
a warning is issued. The default is that such warnings are
generated.
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwX
@emph{Suppress warnings on Export/Import pragmas.}
and correcting such incompatibilities. The default is that
these warnings are generated. Note that at one point Ada 2005
was called Ada 0Y, hence the choice of character.
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwY
@emph{Disable warnings for Ada compatibility issues.}
is that such warnings are generated. Warnings are also
generated for subprogram pointers with different conventions,
and, on VMS only, for data pointers with different conventions.
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatwZ
@emph{Suppress warnings on unchecked conversions.}
size is not a multiple of the alignment, resulting in an object
size that is greater than the specified size. The default
is that such warnings are generated.
-This warning can also be turned on using @option{-gnatwa}.
@item -gnatw.Z
@emph{Suppress warnings for size not a multiple of alignment.}
else
return False;
end if;
- return False;
end case;
return True;
procedure WA_Warnings is
begin
- Check_Unreferenced := True;
- Check_Unreferenced_Formals := True;
- Check_Withs := True;
- Constant_Condition_Warnings := True;
- Implementation_Unit_Warnings := True;
- Ineffective_Inline_Warnings := True;
- Warn_On_Ada_2005_Compatibility := True;
- Warn_On_Ada_2012_Compatibility := True;
- Warn_On_Assertion_Failure := True;
- Warn_On_Assumed_Low_Bound := True;
- Warn_On_Bad_Fixed_Value := True;
- Warn_On_Biased_Representation := True;
- Warn_On_Constant := True;
- Warn_On_Export_Import := True;
- Warn_On_Modified_Unread := True;
- Warn_On_No_Value_Assigned := True;
- Warn_On_Non_Local_Exception := True;
- Warn_On_Object_Renames_Function := True;
- Warn_On_Obsolescent_Feature := True;
- Warn_On_Overlap := True;
- Warn_On_Parameter_Order := True;
- Warn_On_Questionable_Missing_Parens := True;
- Warn_On_Redundant_Constructs := True;
- Warn_On_Reverse_Bit_Order := True;
- Warn_On_Size_Alignment := True;
- Warn_On_Suspicious_Contract := True;
- Warn_On_Unchecked_Conversion := True;
- Warn_On_Unrecognized_Pragma := True;
- Warn_On_Unrepped_Components := True;
+ Check_Unreferenced := True; -- -gnatwf/-gnatwu
+ Check_Unreferenced_Formals := True; -- -gnatwf/-gnatwu
+ Check_Withs := True; -- -gnatwu
+ Constant_Condition_Warnings := True; -- -gnatwc
+ Implementation_Unit_Warnings := True; -- -gnatwi
+ Ineffective_Inline_Warnings := True; -- -gnatwp
+ Warn_On_Ada_2005_Compatibility := True; -- -gnatwy
+ Warn_On_Ada_2012_Compatibility := True; -- -gnatwy
+ Warn_On_Assertion_Failure := True; -- -gnatw.a
+ Warn_On_Assumed_Low_Bound := True; -- -gnatww
+ Warn_On_Bad_Fixed_Value := True; -- -gnatwb
+ Warn_On_Biased_Representation := True; -- -gnatw.b
+ Warn_On_Constant := True; -- -gnatwk
+ Warn_On_Export_Import := True; -- -gnatwx
+ Warn_On_Modified_Unread := True; -- -gnatwm
+ Warn_On_No_Value_Assigned := True; -- -gnatwv
+ Warn_On_Non_Local_Exception := True; -- -gnatw.x
+ Warn_On_Object_Renames_Function := True; -- -gnatw.r
+ Warn_On_Obsolescent_Feature := True; -- -gnatwj
+ Warn_On_Overlap := True; -- -gnatw.i
+ Warn_On_Parameter_Order := True; -- -gnatw.p
+ Warn_On_Questionable_Missing_Parens := True; -- -gnatwq
+ Warn_On_Redundant_Constructs := True; -- -gnatwr
+ Warn_On_Reverse_Bit_Order := True; -- -gnatw.v
+ Warn_On_Size_Alignment := True; -- -gnatw.z
+ Warn_On_Suspicious_Contract := True; -- -gnatw.t
+ Warn_On_Suspicious_Modulus_Value := True; -- -gnatw.m
+ Warn_On_Unchecked_Conversion := True; -- -gnatwz
+ Warn_On_Unrecognized_Pragma := True; -- -gnatwg
+ Warn_On_Unrepped_Components := True; -- -gnatw.c
end WA_Warnings;
end Warnsw;