hppa: Revise REG+D address support to allow long displacements before reload
[official-gcc.git] / gcc / ada / warnsw.ads
blobcee1f302490f529c262deb764905c44bea7533cd
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- W A R N S W --
6 -- --
7 -- S p e c --
8 -- --
9 -- Copyright (C) 1999-2023, Free Software Foundation, Inc. --
10 -- --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
20 -- --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
23 -- --
24 ------------------------------------------------------------------------------
26 -- This unit contains the routines used to handle setting of warning options
27 -- in the GNAT compiler.
29 package Warnsw is
31 -------------------
32 -- Warning Flags --
33 -------------------
35 -- These flags are activated or deactivated by -gnatw switches and control
36 -- whether warnings of a given class will be generated or not.
38 package Warnings_Package is
39 type Opt_Warnings_Enum is
40 -- List of all warnings that can be enabled, plus the two null-ish
41 -- values.
42 (No_Such_Warning, Special_Case, -- see body
44 Address_Clause_Overlay_Warnings,
45 Check_Unreferenced,
46 Check_Unreferenced_Formals,
47 Check_Withs,
48 Constant_Condition_Warnings,
49 Elab_Info_Messages,
50 Elab_Warnings,
51 Implementation_Unit_Warnings,
52 Ineffective_Inline_Warnings,
53 List_Body_Required_Info,
54 List_Inherited_Aspects,
55 Warning_Doc_Switch,
56 Warn_On_Ada_2005_Compatibility,
57 Warn_On_Ada_2012_Compatibility,
58 Warn_On_Ada_2022_Compatibility,
59 Warn_On_All_Unread_Out_Parameters,
60 Warn_On_Anonymous_Allocators,
61 Warn_On_Assertion_Failure,
62 Warn_On_Assumed_Low_Bound,
63 Warn_On_Atomic_Synchronization,
64 Warn_On_Bad_Fixed_Value,
65 Warn_On_Biased_Representation,
66 Warn_On_Component_Order,
67 Warn_On_Constant,
68 Warn_On_Deleted_Code,
69 Warn_On_Dereference,
70 Warn_On_Elab_Access,
71 Warn_On_Export_Import,
72 Warn_On_Hiding,
73 Warn_On_Ignored_Equality,
74 Warn_On_Ineffective_Predicate_Test,
75 Warn_On_Late_Primitives,
76 Warn_On_Modified_Unread,
77 Warn_On_No_Value_Assigned,
78 Warn_On_Non_Local_Exception,
79 No_Warn_On_Non_Local_Exception,
80 Warn_On_Object_Renames_Function,
81 Warn_On_Obsolescent_Feature,
82 Warn_On_Overlap,
83 Warn_On_Overridden_Size,
84 Warn_On_Parameter_Order,
85 Warn_On_Pedantic_Checks,
86 Warn_On_Questionable_Layout,
87 Warn_On_Questionable_Missing_Parens,
88 Warn_On_Record_Holes,
89 Warn_On_Redundant_Constructs,
90 Warn_On_Reverse_Bit_Order,
91 Warn_On_Size_Alignment,
92 Warn_On_Standard_Redefinition,
93 Warn_On_Suspicious_Contract,
94 Warn_On_Suspicious_Modulus_Value,
95 Warn_On_Unchecked_Conversion,
96 Warn_On_Unknown_Compile_Time_Warning,
97 Warn_On_Unordered_Enumeration_Type,
98 Warn_On_Unrecognized_Pragma,
99 Warn_On_Unrepped_Components,
100 Warn_On_Warnings_Off); -- Opt_Warnings_Enum
102 subtype Warnings_Enum is Opt_Warnings_Enum
103 range Opt_Warnings_Enum'Succ (Special_Case) .. Opt_Warnings_Enum'Last;
104 -- Just the warning switches, without the null-ish values
105 end Warnings_Package;
106 use Warnings_Package;
108 type Warnings_State is array (Warnings_Enum) of Boolean;
109 pragma Pack (Warnings_State);
110 -- Without Pack, we can have bootstrapping failures, because the compiler
111 -- generates calls to System.Boolean_Array_Operations, which is not
112 -- currently part of the compiler.
114 Warning_Flags : Warnings_State :=
115 -- Current state of warnings -- True/False means enabled/disabled.
116 -- The following initializes the flags to their default values,
117 -- and warning switches modify them.
118 (Address_Clause_Overlay_Warnings |
119 Elab_Warnings |
120 Implementation_Unit_Warnings |
121 Warning_Doc_Switch |
122 Warn_On_Ada_2005_Compatibility |
123 Warn_On_Ada_2012_Compatibility |
124 Warn_On_Ada_2022_Compatibility |
125 Warn_On_Assertion_Failure |
126 Warn_On_Assumed_Low_Bound |
127 Warn_On_Biased_Representation |
128 Warn_On_Export_Import |
129 Warn_On_No_Value_Assigned |
130 Warn_On_Questionable_Missing_Parens |
131 Warn_On_Reverse_Bit_Order |
132 Warn_On_Size_Alignment |
133 Warn_On_Suspicious_Contract |
134 Warn_On_Suspicious_Modulus_Value |
135 Warn_On_Unchecked_Conversion |
136 Warn_On_Unknown_Compile_Time_Warning |
137 Warn_On_Unrecognized_Pragma =>
138 True,
140 Check_Unreferenced |
141 Check_Unreferenced_Formals |
142 Check_Withs |
143 Constant_Condition_Warnings |
144 Elab_Info_Messages |
145 Ineffective_Inline_Warnings |
146 List_Body_Required_Info |
147 List_Inherited_Aspects |
148 Warn_On_All_Unread_Out_Parameters |
149 Warn_On_Anonymous_Allocators |
150 Warn_On_Atomic_Synchronization |
151 Warn_On_Bad_Fixed_Value |
152 Warn_On_Component_Order |
153 Warn_On_Constant |
154 Warn_On_Deleted_Code |
155 Warn_On_Dereference |
156 Warn_On_Elab_Access |
157 Warn_On_Hiding |
158 Warn_On_Ignored_Equality |
159 Warn_On_Ineffective_Predicate_Test |
160 Warn_On_Late_Primitives |
161 Warn_On_Modified_Unread |
162 Warn_On_Non_Local_Exception |
163 No_Warn_On_Non_Local_Exception |
164 Warn_On_Object_Renames_Function |
165 Warn_On_Obsolescent_Feature |
166 Warn_On_Overlap |
167 Warn_On_Overridden_Size |
168 Warn_On_Parameter_Order |
169 Warn_On_Pedantic_Checks |
170 Warn_On_Questionable_Layout |
171 Warn_On_Record_Holes |
172 Warn_On_Redundant_Constructs |
173 Warn_On_Standard_Redefinition |
174 Warn_On_Unordered_Enumeration_Type |
175 Warn_On_Unrepped_Components |
176 Warn_On_Warnings_Off =>
177 False);
179 package X renames Warnings_Package;
180 F : Warnings_State renames Warning_Flags;
181 -- Short-hand names used only locally to this package
183 -- The following rename all the components of Warning_Flags for convenient
184 -- access throughout the compiler.
186 pragma Style_Checks ("M120");
187 Address_Clause_Overlay_Warnings : Boolean renames F (X.Address_Clause_Overlay_Warnings);
188 -- Set False to disable address clause warnings. Modified by use of
189 -- -gnatwo/O.
191 Check_Unreferenced : Boolean renames F (X.Check_Unreferenced);
192 -- Set to True to enable checking for unreferenced entities other
193 -- than formal parameters (for which see Check_Unreferenced_Formals)
194 -- Modified by use of -gnatwu/U.
196 Check_Unreferenced_Formals : Boolean renames F (X.Check_Unreferenced_Formals);
197 -- Set to True to check for unreferenced formals. This is turned on by
198 -- -gnatwa/wf/wu and turned off by -gnatwA/wF/wU.
200 Check_Withs : Boolean renames F (X.Check_Withs);
201 -- Set to True to enable checking for unused withs, and also the case
202 -- of withing a package and using none of the entities in the package.
203 -- Modified by use of -gnatwu/U.
205 Constant_Condition_Warnings : Boolean renames F (X.Constant_Condition_Warnings);
206 -- Set to True to activate warnings on constant conditions. Modified by
207 -- use of -gnatwc/C.
209 Elab_Info_Messages : Boolean renames F (X.Elab_Info_Messages);
210 -- Set to True to output info messages for static elabmodel (-gnatel)
212 Elab_Warnings : Boolean renames F (X.Elab_Warnings);
213 -- Set to True to generate elaboration warnings (-gnatwl). The warnings are
214 -- enabled by default because they carry the same importance as errors. The
215 -- compiler cannot emit actual errors because elaboration diagnostics need
216 -- dataflow analysis, which is not available. This behavior parallels that
217 -- of the old ABE mechanism.
219 Implementation_Unit_Warnings : Boolean renames F (X.Implementation_Unit_Warnings);
220 -- Set True to activate warnings for use of implementation internal units.
221 -- Modified by use of -gnatwi/-gnatwI.
223 Ineffective_Inline_Warnings : Boolean renames F (X.Ineffective_Inline_Warnings);
224 -- Set True to activate warnings if front-end inlining (-gnatN) is not able
225 -- to actually inline a particular call (or all calls). Can be controlled
226 -- by use of -gnatwp/-gnatwP. Also set True to activate warnings if
227 -- frontend inlining is not able to inline a subprogram expected to
228 -- be inlined in GNATprove mode.
230 List_Body_Required_Info : Boolean renames F (X.List_Body_Required_Info);
231 -- List info messages about why a package requires a body. Modified by use
232 -- of -gnatw.y/.Y.
234 List_Inherited_Aspects : Boolean renames F (X.List_Inherited_Aspects);
235 -- List inherited invariants, preconditions, and postconditions from
236 -- Invariant'Class, Pre'Class, and Post'Class aspects. Also list inherited
237 -- subtype predicates. Modified by use of -gnatw.l/.L.
239 Warning_Doc_Switch : Boolean renames F (X.Warning_Doc_Switch);
240 -- If this is set True, then the ??/?*?/?$?/?x?/?.x?/?_x? insertion
241 -- sequences in error messages generate appropriate tags for the output
242 -- error messages. If this switch is False, then these sequences are still
243 -- recognized (for the purposes of implementing the pattern matching in
244 -- pragmas Warnings (Off,..) and Warning_As_Error(...) but do not result
245 -- in adding the error message tag. The -gnatw.d switch sets this flag
246 -- True, -gnatw.D sets this flag False.
248 Warn_On_Ada_2005_Compatibility : Boolean renames F (X.Warn_On_Ada_2005_Compatibility);
249 -- Set to True to generate all warnings on Ada 2005 compatibility issues,
250 -- including warnings on Ada 2005 obsolescent features used in Ada 2005
251 -- mode. Set by default, modified by use of -gnatwy/Y.
253 Warn_On_Ada_2012_Compatibility : Boolean renames F (X.Warn_On_Ada_2012_Compatibility);
254 -- Set to True to generate all warnings on Ada 2012 compatibility issues,
255 -- including warnings on Ada 2012 obsolescent features used in Ada 2012
256 -- mode. Modified by use of -gnatwy/Y.
258 Warn_On_Ada_2022_Compatibility : Boolean renames F (X.Warn_On_Ada_2022_Compatibility);
259 -- Set to True to generate all warnings on Ada 2022 compatibility issues,
260 -- including warnings on Ada 2022 obsolescent features used in Ada 2022
261 -- mode. There is no switch controlling this option.
263 Warn_On_All_Unread_Out_Parameters : Boolean renames F (X.Warn_On_All_Unread_Out_Parameters);
264 -- Set to True to generate warnings in all cases where a variable is
265 -- modified by being passed as to an OUT formal, but the resulting value is
266 -- never read. The default is that this warning is suppressed. Modified
267 -- by use of gnatw.o/.O.
269 Warn_On_Anonymous_Allocators : Boolean renames F (X.Warn_On_Anonymous_Allocators);
270 -- Warn when allocators for anonymous access types are present, which,
271 -- although not illegal in Ada, may be confusing to users due to how
272 -- accessibility checks get generated. Off by default, modified by use
273 -- of -gnatw_a/_A and set as part of -gnatwa.
275 Warn_On_Assertion_Failure : Boolean renames F (X.Warn_On_Assertion_Failure);
276 -- Set to True to activate warnings on assertions that can be determined
277 -- at compile time will always fail. Modified by use of -gnatw.a/.A.
279 Warn_On_Assumed_Low_Bound : Boolean renames F (X.Warn_On_Assumed_Low_Bound);
280 -- Set to True to activate warnings for string parameters that are indexed
281 -- with literals or S'Length, presumably assuming a lower bound of one.
282 -- Modified by use of -gnatww/W.
284 Warn_On_Atomic_Synchronization : Boolean renames F (X.Warn_On_Atomic_Synchronization);
285 -- Set to True to generate information messages for atomic synchronization.
286 -- Modified by use of -gnatw.n/.N.
288 Warn_On_Bad_Fixed_Value : Boolean renames F (X.Warn_On_Bad_Fixed_Value);
289 -- Set to True to generate warnings for static fixed-point expression
290 -- values that are not an exact multiple of the small value of the type.
291 -- Odd by default, modified by use of -gnatwb/B.
293 Warn_On_Biased_Representation : Boolean renames F (X.Warn_On_Biased_Representation);
294 -- Set to True to generate warnings for size clauses, component clauses
295 -- and component_size clauses that force biased representation. Modified
296 -- by use of -gnatw.b/.B.
298 Warn_On_Component_Order : Boolean renames F (X.Warn_On_Component_Order);
299 -- Warn when record component clauses are out of order with respect to the
300 -- component declarations, or if the memory layout is out of order with
301 -- respect to component declarations and clauses. Off by default, set by
302 -- -gnatw_r (but not -gnatwa).
304 Warn_On_Constant : Boolean renames F (X.Warn_On_Constant);
305 -- Set to True to generate warnings for variables that could be declared
306 -- as constants. Modified by use of -gnatwk/K.
308 Warn_On_Deleted_Code : Boolean renames F (X.Warn_On_Deleted_Code);
309 -- Set to True to generate warnings for code deleted by the front end
310 -- for conditional statements whose outcome is known at compile time.
311 -- Modified by use of -gnatwt/T.
313 Warn_On_Dereference : Boolean renames F (X.Warn_On_Dereference);
314 -- Set to True to generate warnings for implicit dereferences for array
315 -- indexing and record component access. Modified by use of -gnatwd/D.
317 Warn_On_Elab_Access : Boolean renames F (X.Warn_On_Elab_Access);
318 -- Set to True to generate warnings for P'Access in the case where
319 -- subprogram P is in the same package as the P'Access, and the P'Access is
320 -- evaluated at package elaboration time, and occurs before the body of P
321 -- has been elaborated. Modified by use of -gnatw.f/.F.
323 Warn_On_Export_Import : Boolean renames F (X.Warn_On_Export_Import);
324 -- Set to True to generate warnings for suspicious use of export or
325 -- import pragmas. Modified by use of -gnatwx/X.
327 Warn_On_Hiding : Boolean renames F (X.Warn_On_Hiding);
328 -- Set to True to generate warnings if a declared entity hides another
329 -- entity. The default is that this warning is suppressed. Modified by
330 -- use of -gnatwh/H.
332 Warn_On_Ignored_Equality : Boolean renames F (X.Warn_On_Ignored_Equality);
333 -- Warn when a user-defined "=" function does not compose (i.e. is ignored
334 -- for a predefined "=" for a composite type containing a component of
335 -- whose type has the user-defined "=" as primitive). Off by default, and
336 -- set by -gnatw_q (but not -gnatwa).
338 Warn_On_Ineffective_Predicate_Test : Boolean renames F (X.Warn_On_Ineffective_Predicate_Test);
339 -- Set to True to generate warnings if a static predicate is testing for
340 -- values that do not belong to the parent subtype. Modified by use of
341 -- -gnatw_s/S.
343 Warn_On_Late_Primitives : Boolean renames F (X.Warn_On_Late_Primitives);
344 -- Warn when tagged type public primitives are defined after its private
345 -- extensions.
347 Warn_On_Modified_Unread : Boolean renames F (X.Warn_On_Modified_Unread);
348 -- Set to True to generate warnings if a variable is assigned but is never
349 -- read. Also controls warnings for similar cases involving out parameters,
350 -- but only if there is only one out parameter for the procedure involved.
351 -- The default is that this warning is suppressed, modified by use of
352 -- -gnatwm/M.
354 Warn_On_No_Value_Assigned : Boolean renames F (X.Warn_On_No_Value_Assigned);
355 -- Set to True to generate warnings if no value is ever assigned to a
356 -- variable that is at least partially uninitialized. Set to false to
357 -- suppress such warnings. The default is that such warnings are enabled.
358 -- Modified by use of -gnatwv/V.
360 Warn_On_Non_Local_Exception : Boolean renames F (X.Warn_On_Non_Local_Exception);
361 -- Set to True to generate warnings for non-local exception raises and also
362 -- handlers that can never handle a local raise. This warning is only ever
363 -- generated if pragma Restrictions (No_Exception_Propagation) is set. The
364 -- default is not to generate the warnings except that if the source has
365 -- at least one exception handler, and this restriction is set, and the
366 -- warning was not explicitly turned off, then it is turned on by default.
367 -- Modified by use of -gnatw.x/.X.
369 No_Warn_On_Non_Local_Exception : Boolean renames F (X.No_Warn_On_Non_Local_Exception);
370 -- This is set to True if the above warning is explicitly suppressed. We
371 -- use this to avoid turning it on by default when No_Exception_Propagation
372 -- restriction is set and an exception handler is present.
374 Warn_On_Object_Renames_Function : Boolean renames F (X.Warn_On_Object_Renames_Function);
375 -- Set to True to generate warnings when a function result is renamed as
376 -- an object. The default is that this warning is disabled. Modified by
377 -- use of -gnatw.r/.R.
379 Warn_On_Obsolescent_Feature : Boolean renames F (X.Warn_On_Obsolescent_Feature);
380 -- Set to True to generate warnings on use of any feature in Annex or if a
381 -- subprogram is called for which a pragma Obsolescent applies. Modified
382 -- by use of -gnatwj/J.
384 Warn_On_Overlap : Boolean renames F (X.Warn_On_Overlap);
385 -- Set to True to generate warnings when a writable actual overlaps with
386 -- another actual in a subprogram call. This applies only in modes before
387 -- Ada 2012. Starting with Ada 2012, such overlaps are illegal.
388 -- Modified by use of -gnatw.i/.I.
390 Warn_On_Overridden_Size : Boolean renames F (X.Warn_On_Overridden_Size);
391 -- Warn when explicit record component clause or array component_size
392 -- clause specifies a size that overrides a size for the type which was
393 -- set with an explicit size clause. Off by default, modified by use of
394 -- -gnatw.s/.S (but not -gnatwa).
396 Warn_On_Parameter_Order : Boolean renames F (X.Warn_On_Parameter_Order);
397 -- Set to True to generate warnings for cases where the argument list for
398 -- a call is a sequence of identifiers that match the formal identifiers,
399 -- but are in the wrong order.
401 Warn_On_Pedantic_Checks : Boolean renames F (X.Warn_On_Pedantic_Checks);
402 -- Warn for violation of miscellaneous pedantic rules (such as when the
403 -- subtype of a formal parameter given in a subprogram body's specification
404 -- comes from a different subtype declaration that the subtype of the
405 -- formal in the subprogram declaration). Off by default, and set by
406 -- -gnatw_p (but not -gnatwa).
408 Warn_On_Questionable_Layout : Boolean renames F (X.Warn_On_Questionable_Layout);
409 -- Warn when default layout of a record type is questionable for run-time
410 -- efficiency reasons and would be improved by reordering the components.
411 -- Off by default, modified by use of -gnatw.q/.Q (but not -gnatwa).
413 function Get_Warn_On_Questionable_Layout return Boolean is
414 (Warn_On_Questionable_Layout);
415 -- WARNING: There is a matching C declaration of this function in fe.h
417 Warn_On_Questionable_Missing_Parens : Boolean renames F (X.Warn_On_Questionable_Missing_Parens);
418 -- Set to True to generate warnings for cases where parentheses are missing
419 -- and the usage is questionable, because the intent is unclear. On by
420 -- default, modified by use of -gnatwq/Q.
422 Warn_On_Record_Holes : Boolean renames F (X.Warn_On_Record_Holes);
423 -- Warn when explicit record component clauses leave uncovered holes (gaps)
424 -- in a record layout. Off by default, set by -gnatw.h (but not -gnatwa).
426 Warn_On_Redundant_Constructs : Boolean renames F (X.Warn_On_Redundant_Constructs);
427 -- Set to True to generate warnings for redundant constructs (e.g. useless
428 -- assignments/conversions). The default is that this warning is disabled.
429 -- Modified by use of -gnatwr/R.
431 Warn_On_Reverse_Bit_Order : Boolean renames F (X.Warn_On_Reverse_Bit_Order);
432 -- Set to True to generate warning (informational) messages for component
433 -- clauses that are affected by non-standard bit-order. The default is
434 -- that this warning is enabled. Modified by -gnatw.v/.V.
436 Warn_On_Size_Alignment : Boolean renames F (X.Warn_On_Size_Alignment);
437 -- Warn when explicit Size and Alignment clauses are given for a type, and
438 -- the size is not a multiple of the alignment. Off by default, modified
439 -- by use of -gnatw.z/.Z and set as part of -gnatwa.
441 Warn_On_Standard_Redefinition : Boolean renames F (X.Warn_On_Standard_Redefinition);
442 -- Warn when a program defines an identifier that matches a name in
443 -- Standard. Off by default, modified by use of -gnatw.k/.K (but not
444 -- by -gnatwa).
446 Warn_On_Suspicious_Contract : Boolean renames F (X.Warn_On_Suspicious_Contract);
447 -- Set to True to generate warnings for suspicious contracts expressed as
448 -- pragmas or aspects precondition and postcondition, as well as other
449 -- suspicious cases of expressions typically found in contracts like
450 -- quantified expressions and uses of Update attribute. The default is that
451 -- this warning is enabled. Modified by use of -gnatw.t/.T.
453 Warn_On_Suspicious_Modulus_Value : Boolean renames F (X.Warn_On_Suspicious_Modulus_Value);
454 -- Set to True to generate warnings for suspicious modulus values, as well
455 -- as negative literals of a modular type. The default is that this warning
456 -- is enabled. Modified by -gnatw.m/.M.
458 Warn_On_Unchecked_Conversion : Boolean renames F (X.Warn_On_Unchecked_Conversion);
459 -- Set to True to generate warnings for unchecked conversions that may have
460 -- non-portable semantics (e.g. because sizes of types differ). Modified
461 -- by use of -gnatwz/Z.
463 Warn_On_Unknown_Compile_Time_Warning : Boolean renames F (X.Warn_On_Unknown_Compile_Time_Warning);
464 -- Warn on a pragma Compile_Time_Warning whose condition has a value that
465 -- is not known at compile time. On by default, modified by use
466 -- of -gnatw_c/_C and set as part of -gnatwa.
468 Warn_On_Unordered_Enumeration_Type : Boolean renames F (X.Warn_On_Unordered_Enumeration_Type);
469 -- Set to True to generate warnings for inappropriate uses (comparisons
470 -- and explicit ranges) on unordered enumeration types (which includes
471 -- all enumeration types for which pragma Ordered is not given). The
472 -- default is that this warning is disabled. Modified by -gnat.u/.U.
474 Warn_On_Unrecognized_Pragma : Boolean renames F (X.Warn_On_Unrecognized_Pragma);
475 -- Set to True to generate warnings for unrecognized pragmas. The default
476 -- is that this warning is enabled. Modified by use of -gnatwg/G.
478 Warn_On_Unrepped_Components : Boolean renames F (X.Warn_On_Unrepped_Components);
479 -- Set to True to generate warnings for the case of components of record
480 -- which have a record representation clause but this component does not
481 -- have a component clause. Modified by use of -gnatw.c/.C.
483 Warn_On_Warnings_Off : Boolean renames F (X.Warn_On_Warnings_Off);
484 -- Set to True to generate warnings for use of Pragma Warnings (Off, ent),
485 -- where either the pragma is never used, or it could be replaced by a
486 -- pragma Unmodified or Unreferenced. Also generates warnings for pragma
487 -- Warning (Off, string) which either has no matching pragma Warning On,
488 -- or where no warning has been suppressed by the use of the pragma.
489 -- Modified by use of -gnatw.w/.W.
490 pragma Style_Checks ("M79");
492 -----------------------------------
493 -- Saving and Restoring Warnings --
494 -----------------------------------
496 function Save_Warnings return Warnings_State;
497 -- Returns current settings of warnings
499 procedure Restore_Warnings (W : Warnings_State);
500 -- Restores current settings of warning flags from W
502 -----------------
503 -- Subprograms --
504 -----------------
506 type Warning_Family is
507 -- The "family" indicates the form of warning switch:
508 (Plain, -- form "-gnatwx"
509 '.', -- form "-gnatw.x"
510 '_'); -- form "-gnatw_x"
511 -- where "x" is a lowercase letter that enables a particular warning.
512 -- Typically, uppercase of "x" disables the warning, but there are some
513 -- switches that do not follow that pattern.
515 function Set_Warning_Switch
516 (Family : Warning_Family; C : Character) return Boolean;
517 -- Set the warning switch or switches corresponding to the given family and
518 -- character. Returns True for valid warning switch, False for invalid.
519 -- Called for -gnatw... switches, and for pragma Warnings.
521 procedure Set_GNAT_Mode_Warnings;
522 -- Called for -gnatg and -gnatw.g to set GNAT mode warnings. This set of
523 -- warnings is neither a subset nor a superset of -gnatwa.
525 end Warnsw;