[aarch64] Use op_mode instead of vmode in aarch64_vectorize_vec_perm_const.
[official-gcc.git] / gcc / ada / warnsw.adb
blob4a7dcc3bdea26a0d45fa6e9c94ae6684096a694c
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- W A R N S W --
6 -- --
7 -- B o d y --
8 -- --
9 -- Copyright (C) 1999-2022, 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 with Err_Vars; use Err_Vars;
27 with Opt; use Opt;
28 with Output; use Output;
30 package body Warnsw is
32 -- Local Subprograms
34 procedure All_Warnings (Setting : Boolean);
35 -- Sets all warnings off if Setting = False, and on if Setting = True
37 procedure WA_Warnings;
38 -- Turn on all warnings set by -gnatwa (also used by -gnatw.g)
40 ------------------
41 -- All_Warnings --
42 ------------------
44 procedure All_Warnings (Setting : Boolean) is
45 begin
46 Address_Clause_Overlay_Warnings := Setting;
47 Check_Unreferenced := Setting;
48 Check_Unreferenced_Formals := Setting;
49 Check_Withs := Setting;
50 Constant_Condition_Warnings := Setting;
51 Elab_Warnings := Setting;
52 Implementation_Unit_Warnings := Setting;
53 Ineffective_Inline_Warnings := Setting;
54 List_Body_Required_Info := Setting;
55 List_Inherited_Aspects := Setting;
56 Warn_On_Ada_2005_Compatibility := Setting;
57 Warn_On_Ada_2012_Compatibility := Setting;
58 Warn_On_All_Unread_Out_Parameters := Setting;
59 Warn_On_Anonymous_Allocators := Setting;
60 Warn_On_Assertion_Failure := Setting;
61 Warn_On_Assumed_Low_Bound := Setting;
62 Warn_On_Atomic_Synchronization := Setting;
63 Warn_On_Bad_Fixed_Value := Setting;
64 Warn_On_Biased_Representation := Setting;
65 Warn_On_Constant := Setting;
66 Warn_On_Deleted_Code := Setting;
67 Warn_On_Dereference := Setting;
68 Warn_On_Export_Import := Setting;
69 Warn_On_Hiding := Setting;
70 Warn_On_Late_Primitives := Setting;
71 Warn_On_Modified_Unread := Setting;
72 Warn_On_No_Value_Assigned := Setting;
73 Warn_On_Non_Local_Exception := Setting;
74 Warn_On_Object_Renames_Function := Setting;
75 Warn_On_Obsolescent_Feature := Setting;
76 Warn_On_Overlap := Setting;
77 Warn_On_Overridden_Size := Setting;
78 Warn_On_Parameter_Order := Setting;
79 Warn_On_Pedantic_Checks := Setting;
80 Warn_On_Questionable_Layout := Setting;
81 Warn_On_Questionable_Missing_Parens := Setting;
82 Warn_On_Record_Holes := Setting;
83 Warn_On_Component_Order := Setting;
84 Warn_On_Redundant_Constructs := Setting;
85 Warn_On_Reverse_Bit_Order := Setting;
86 Warn_On_Size_Alignment := Setting;
87 Warn_On_Standard_Redefinition := Setting;
88 Warn_On_Suspicious_Contract := Setting;
89 Warn_On_Suspicious_Modulus_Value := Setting;
90 Warn_On_Unchecked_Conversion := Setting;
91 Warn_On_Unknown_Compile_Time_Warning := Setting;
92 Warn_On_Unordered_Enumeration_Type := Setting;
93 Warn_On_Unrecognized_Pragma := Setting;
94 Warn_On_Unrepped_Components := Setting;
95 Warn_On_Warnings_Off := Setting;
96 end All_Warnings;
98 ----------------------
99 -- Restore_Warnings --
100 ----------------------
102 procedure Restore_Warnings (W : Warning_Record) is
103 begin
104 Address_Clause_Overlay_Warnings :=
105 W.Address_Clause_Overlay_Warnings;
106 Check_Unreferenced :=
107 W.Check_Unreferenced;
108 Check_Unreferenced_Formals :=
109 W.Check_Unreferenced_Formals;
110 Check_Withs :=
111 W.Check_Withs;
112 Constant_Condition_Warnings :=
113 W.Constant_Condition_Warnings;
114 Elab_Warnings :=
115 W.Elab_Warnings;
116 Elab_Info_Messages :=
117 W.Elab_Info_Messages;
118 Implementation_Unit_Warnings :=
119 W.Implementation_Unit_Warnings;
120 Ineffective_Inline_Warnings :=
121 W.Ineffective_Inline_Warnings;
122 List_Body_Required_Info :=
123 W.List_Body_Required_Info;
124 List_Inherited_Aspects :=
125 W.List_Inherited_Aspects;
126 No_Warn_On_Non_Local_Exception :=
127 W.No_Warn_On_Non_Local_Exception;
128 Warning_Doc_Switch :=
129 W.Warning_Doc_Switch;
130 Warn_On_Ada_2005_Compatibility :=
131 W.Warn_On_Ada_2005_Compatibility;
132 Warn_On_Ada_2012_Compatibility :=
133 W.Warn_On_Ada_2012_Compatibility;
134 Warn_On_All_Unread_Out_Parameters :=
135 W.Warn_On_All_Unread_Out_Parameters;
136 Warn_On_Anonymous_Allocators :=
137 W.Warn_On_Anonymous_Allocators;
138 Warn_On_Assertion_Failure :=
139 W.Warn_On_Assertion_Failure;
140 Warn_On_Assumed_Low_Bound :=
141 W.Warn_On_Assumed_Low_Bound;
142 Warn_On_Atomic_Synchronization :=
143 W.Warn_On_Atomic_Synchronization;
144 Warn_On_Bad_Fixed_Value :=
145 W.Warn_On_Bad_Fixed_Value;
146 Warn_On_Biased_Representation :=
147 W.Warn_On_Biased_Representation;
148 Warn_On_Constant :=
149 W.Warn_On_Constant;
150 Warn_On_Deleted_Code :=
151 W.Warn_On_Deleted_Code;
152 Warn_On_Dereference :=
153 W.Warn_On_Dereference;
154 Warn_On_Export_Import :=
155 W.Warn_On_Export_Import;
156 Warn_On_Hiding :=
157 W.Warn_On_Hiding;
158 Warn_On_Late_Primitives :=
159 W.Warn_On_Late_Primitives;
160 Warn_On_Modified_Unread :=
161 W.Warn_On_Modified_Unread;
162 Warn_On_No_Value_Assigned :=
163 W.Warn_On_No_Value_Assigned;
164 Warn_On_Non_Local_Exception :=
165 W.Warn_On_Non_Local_Exception;
166 Warn_On_Object_Renames_Function :=
167 W.Warn_On_Object_Renames_Function;
168 Warn_On_Obsolescent_Feature :=
169 W.Warn_On_Obsolescent_Feature;
170 Warn_On_Overlap :=
171 W.Warn_On_Overlap;
172 Warn_On_Overridden_Size :=
173 W.Warn_On_Overridden_Size;
174 Warn_On_Parameter_Order :=
175 W.Warn_On_Parameter_Order;
176 Warn_On_Pedantic_Checks :=
177 W.Warn_On_Pedantic_Checks;
178 Warn_On_Questionable_Layout :=
179 W.Warn_On_Questionable_Layout;
180 Warn_On_Questionable_Missing_Parens :=
181 W.Warn_On_Questionable_Missing_Parens;
182 Warn_On_Record_Holes :=
183 W.Warn_On_Record_Holes;
184 Warn_On_Component_Order :=
185 W.Warn_On_Component_Order;
186 Warn_On_Redundant_Constructs :=
187 W.Warn_On_Redundant_Constructs;
188 Warn_On_Reverse_Bit_Order :=
189 W.Warn_On_Reverse_Bit_Order;
190 Warn_On_Size_Alignment :=
191 W.Warn_On_Size_Alignment;
192 Warn_On_Standard_Redefinition :=
193 W.Warn_On_Standard_Redefinition;
194 Warn_On_Suspicious_Contract :=
195 W.Warn_On_Suspicious_Contract;
196 Warn_On_Unchecked_Conversion :=
197 W.Warn_On_Unchecked_Conversion;
198 Warn_On_Unknown_Compile_Time_Warning :=
199 W.Warn_On_Unknown_Compile_Time_Warning;
200 Warn_On_Unordered_Enumeration_Type :=
201 W.Warn_On_Unordered_Enumeration_Type;
202 Warn_On_Unrecognized_Pragma :=
203 W.Warn_On_Unrecognized_Pragma;
204 Warn_On_Unrepped_Components :=
205 W.Warn_On_Unrepped_Components;
206 Warn_On_Warnings_Off :=
207 W.Warn_On_Warnings_Off;
208 end Restore_Warnings;
210 -------------------
211 -- Save_Warnings --
212 -------------------
214 function Save_Warnings return Warning_Record is
215 W : Warning_Record;
217 begin
218 W.Address_Clause_Overlay_Warnings :=
219 Address_Clause_Overlay_Warnings;
220 W.Check_Unreferenced :=
221 Check_Unreferenced;
222 W.Check_Unreferenced_Formals :=
223 Check_Unreferenced_Formals;
224 W.Check_Withs :=
225 Check_Withs;
226 W.Constant_Condition_Warnings :=
227 Constant_Condition_Warnings;
228 W.Elab_Info_Messages :=
229 Elab_Info_Messages;
230 W.Elab_Warnings :=
231 Elab_Warnings;
232 W.Implementation_Unit_Warnings :=
233 Implementation_Unit_Warnings;
234 W.Ineffective_Inline_Warnings :=
235 Ineffective_Inline_Warnings;
236 W.List_Body_Required_Info :=
237 List_Body_Required_Info;
238 W.List_Inherited_Aspects :=
239 List_Inherited_Aspects;
240 W.No_Warn_On_Non_Local_Exception :=
241 No_Warn_On_Non_Local_Exception;
242 W.Warning_Doc_Switch :=
243 Warning_Doc_Switch;
244 W.Warn_On_Ada_2005_Compatibility :=
245 Warn_On_Ada_2005_Compatibility;
246 W.Warn_On_Ada_2012_Compatibility :=
247 Warn_On_Ada_2012_Compatibility;
248 W.Warn_On_All_Unread_Out_Parameters :=
249 Warn_On_All_Unread_Out_Parameters;
250 W.Warn_On_Anonymous_Allocators :=
251 Warn_On_Anonymous_Allocators;
252 W.Warn_On_Assertion_Failure :=
253 Warn_On_Assertion_Failure;
254 W.Warn_On_Assumed_Low_Bound :=
255 Warn_On_Assumed_Low_Bound;
256 W.Warn_On_Atomic_Synchronization :=
257 Warn_On_Atomic_Synchronization;
258 W.Warn_On_Bad_Fixed_Value :=
259 Warn_On_Bad_Fixed_Value;
260 W.Warn_On_Biased_Representation :=
261 Warn_On_Biased_Representation;
262 W.Warn_On_Constant :=
263 Warn_On_Constant;
264 W.Warn_On_Deleted_Code :=
265 Warn_On_Deleted_Code;
266 W.Warn_On_Dereference :=
267 Warn_On_Dereference;
268 W.Warn_On_Export_Import :=
269 Warn_On_Export_Import;
270 W.Warn_On_Hiding :=
271 Warn_On_Hiding;
272 W.Warn_On_Late_Primitives :=
273 Warn_On_Late_Primitives;
274 W.Warn_On_Modified_Unread :=
275 Warn_On_Modified_Unread;
276 W.Warn_On_No_Value_Assigned :=
277 Warn_On_No_Value_Assigned;
278 W.Warn_On_Non_Local_Exception :=
279 Warn_On_Non_Local_Exception;
280 W.Warn_On_Object_Renames_Function :=
281 Warn_On_Object_Renames_Function;
282 W.Warn_On_Obsolescent_Feature :=
283 Warn_On_Obsolescent_Feature;
284 W.Warn_On_Overlap :=
285 Warn_On_Overlap;
286 W.Warn_On_Overridden_Size :=
287 Warn_On_Overridden_Size;
288 W.Warn_On_Parameter_Order :=
289 Warn_On_Parameter_Order;
290 W.Warn_On_Pedantic_Checks :=
291 Warn_On_Pedantic_Checks;
292 W.Warn_On_Questionable_Layout :=
293 Warn_On_Questionable_Layout;
294 W.Warn_On_Questionable_Missing_Parens :=
295 Warn_On_Questionable_Missing_Parens;
296 W.Warn_On_Record_Holes :=
297 Warn_On_Record_Holes;
298 W.Warn_On_Component_Order :=
299 Warn_On_Component_Order;
300 W.Warn_On_Redundant_Constructs :=
301 Warn_On_Redundant_Constructs;
302 W.Warn_On_Reverse_Bit_Order :=
303 Warn_On_Reverse_Bit_Order;
304 W.Warn_On_Size_Alignment :=
305 Warn_On_Size_Alignment;
306 W.Warn_On_Standard_Redefinition :=
307 Warn_On_Standard_Redefinition;
308 W.Warn_On_Suspicious_Contract :=
309 Warn_On_Suspicious_Contract;
310 W.Warn_On_Unchecked_Conversion :=
311 Warn_On_Unchecked_Conversion;
312 W.Warn_On_Unknown_Compile_Time_Warning :=
313 Warn_On_Unknown_Compile_Time_Warning;
314 W.Warn_On_Unordered_Enumeration_Type :=
315 Warn_On_Unordered_Enumeration_Type;
316 W.Warn_On_Unrecognized_Pragma :=
317 Warn_On_Unrecognized_Pragma;
318 W.Warn_On_Unrepped_Components :=
319 Warn_On_Unrepped_Components;
320 W.Warn_On_Warnings_Off :=
321 Warn_On_Warnings_Off;
322 return W;
323 end Save_Warnings;
325 ----------------------------
326 -- Set_Dot_Warning_Switch --
327 ----------------------------
329 function Set_Dot_Warning_Switch (C : Character) return Boolean is
330 begin
331 case C is
332 when 'a' =>
333 Warn_On_Assertion_Failure := True;
335 when 'A' =>
336 Warn_On_Assertion_Failure := False;
338 when 'b' =>
339 Warn_On_Biased_Representation := True;
341 when 'B' =>
342 Warn_On_Biased_Representation := False;
344 when 'c' =>
345 Warn_On_Unrepped_Components := True;
347 when 'C' =>
348 Warn_On_Unrepped_Components := False;
350 when 'd' =>
351 Warning_Doc_Switch := True;
353 when 'D' =>
354 Warning_Doc_Switch := False;
356 when 'e' =>
357 All_Warnings (True);
359 when 'f' =>
360 Warn_On_Elab_Access := True;
362 when 'F' =>
363 Warn_On_Elab_Access := False;
365 when 'g' =>
366 Set_GNAT_Mode_Warnings;
368 when 'h' =>
369 Warn_On_Record_Holes := True;
371 when 'H' =>
372 Warn_On_Record_Holes := False;
374 when 'i' =>
375 Warn_On_Overlap := True;
377 when 'I' =>
378 Warn_On_Overlap := False;
380 when 'j' =>
381 Warn_On_Late_Primitives := True;
383 when 'J' =>
384 Warn_On_Late_Primitives := False;
386 when 'k' =>
387 Warn_On_Standard_Redefinition := True;
389 when 'K' =>
390 Warn_On_Standard_Redefinition := False;
392 when 'l' =>
393 List_Inherited_Aspects := True;
395 when 'L' =>
396 List_Inherited_Aspects := False;
398 when 'm' =>
399 Warn_On_Suspicious_Modulus_Value := True;
401 when 'M' =>
402 Warn_On_Suspicious_Modulus_Value := False;
404 when 'n' =>
405 Warn_On_Atomic_Synchronization := True;
407 when 'N' =>
408 Warn_On_Atomic_Synchronization := False;
410 when 'o' =>
411 Warn_On_All_Unread_Out_Parameters := True;
413 when 'O' =>
414 Warn_On_All_Unread_Out_Parameters := False;
416 when 'p' =>
417 Warn_On_Parameter_Order := True;
419 when 'P' =>
420 Warn_On_Parameter_Order := False;
422 when 'q' =>
423 Warn_On_Questionable_Layout := True;
425 when 'Q' =>
426 Warn_On_Questionable_Layout := False;
428 when 'r' =>
429 Warn_On_Object_Renames_Function := True;
431 when 'R' =>
432 Warn_On_Object_Renames_Function := False;
434 when 's' =>
435 Warn_On_Overridden_Size := True;
437 when 'S' =>
438 Warn_On_Overridden_Size := False;
440 when 't' =>
441 Warn_On_Suspicious_Contract := True;
443 when 'T' =>
444 Warn_On_Suspicious_Contract := False;
446 when 'u' =>
447 Warn_On_Unordered_Enumeration_Type := True;
449 when 'U' =>
450 Warn_On_Unordered_Enumeration_Type := False;
452 when 'v' =>
453 Warn_On_Reverse_Bit_Order := True;
455 when 'V' =>
456 Warn_On_Reverse_Bit_Order := False;
458 when 'w' =>
459 Warn_On_Warnings_Off := True;
461 when 'W' =>
462 Warn_On_Warnings_Off := False;
464 when 'x' =>
465 Warn_On_Non_Local_Exception := True;
467 when 'X' =>
468 Warn_On_Non_Local_Exception := False;
469 No_Warn_On_Non_Local_Exception := True;
471 when 'y' =>
472 List_Body_Required_Info := True;
474 when 'Y' =>
475 List_Body_Required_Info := False;
477 when 'z' =>
478 Warn_On_Size_Alignment := True;
480 when 'Z' =>
481 Warn_On_Size_Alignment := False;
483 when others =>
484 if Ignore_Unrecognized_VWY_Switches then
485 Write_Line ("unrecognized switch -gnatw." & C & " ignored");
486 else
487 return False;
488 end if;
489 end case;
491 return True;
492 end Set_Dot_Warning_Switch;
494 -----------------------------------
495 -- Set_Underscore_Warning_Switch --
496 -----------------------------------
498 function Set_Underscore_Warning_Switch (C : Character) return Boolean is
499 begin
500 case C is
501 when 'a' =>
502 Warn_On_Anonymous_Allocators := True;
504 when 'A' =>
505 Warn_On_Anonymous_Allocators := False;
507 when 'c' =>
508 Warn_On_Unknown_Compile_Time_Warning := True;
510 when 'C' =>
511 Warn_On_Unknown_Compile_Time_Warning := False;
513 when 'p' =>
514 Warn_On_Pedantic_Checks := True;
516 when 'P' =>
517 Warn_On_Pedantic_Checks := False;
519 when 'r' =>
520 Warn_On_Component_Order := True;
522 when 'R' =>
523 Warn_On_Component_Order := False;
525 when others =>
526 if Ignore_Unrecognized_VWY_Switches then
527 Write_Line ("unrecognized switch -gnatw_" & C & " ignored");
528 else
529 return False;
530 end if;
531 end case;
533 return True;
534 end Set_Underscore_Warning_Switch;
536 ----------------------------
537 -- Set_GNAT_Mode_Warnings --
538 ----------------------------
540 procedure Set_GNAT_Mode_Warnings is
541 begin
542 -- Set -gnatwa warnings and no others
544 All_Warnings (False);
545 WA_Warnings;
547 -- These warnings are added to the -gnatwa set
549 Address_Clause_Overlay_Warnings := True;
550 Warn_On_Questionable_Layout := True;
551 Warn_On_Overridden_Size := True;
553 -- These warnings are removed from the -gnatwa set
555 Implementation_Unit_Warnings := False;
556 Warn_On_Non_Local_Exception := False;
557 No_Warn_On_Non_Local_Exception := True;
558 Warn_On_Reverse_Bit_Order := False;
559 Warn_On_Size_Alignment := False;
560 Warn_On_Unrepped_Components := False;
561 end Set_GNAT_Mode_Warnings;
563 ------------------------
564 -- Set_Warning_Switch --
565 ------------------------
567 function Set_Warning_Switch (C : Character) return Boolean is
568 begin
569 case C is
570 when 'a' =>
571 WA_Warnings;
573 when 'A' =>
574 All_Warnings (False);
575 No_Warn_On_Non_Local_Exception := True;
577 when 'b' =>
578 Warn_On_Bad_Fixed_Value := True;
580 when 'B' =>
581 Warn_On_Bad_Fixed_Value := False;
583 when 'c' =>
584 Constant_Condition_Warnings := True;
586 when 'C' =>
587 Constant_Condition_Warnings := False;
589 when 'd' =>
590 Warn_On_Dereference := True;
592 when 'D' =>
593 Warn_On_Dereference := False;
595 when 'e' =>
596 Warning_Mode := Treat_As_Error;
598 when 'E' =>
599 Warning_Mode := Treat_Run_Time_Warnings_As_Errors;
601 when 'f' =>
602 Check_Unreferenced_Formals := True;
604 when 'F' =>
605 Check_Unreferenced_Formals := False;
607 when 'g' =>
608 Warn_On_Unrecognized_Pragma := True;
610 when 'G' =>
611 Warn_On_Unrecognized_Pragma := False;
613 when 'h' =>
614 Warn_On_Hiding := True;
616 when 'H' =>
617 Warn_On_Hiding := False;
619 when 'i' =>
620 Implementation_Unit_Warnings := True;
622 when 'I' =>
623 Implementation_Unit_Warnings := False;
625 when 'j' =>
626 Warn_On_Obsolescent_Feature := True;
628 when 'J' =>
629 Warn_On_Obsolescent_Feature := False;
631 when 'k' =>
632 Warn_On_Constant := True;
634 when 'K' =>
635 Warn_On_Constant := False;
637 when 'l' =>
638 Elab_Warnings := True;
640 when 'L' =>
641 Elab_Warnings := False;
643 when 'm' =>
644 Warn_On_Modified_Unread := True;
646 when 'M' =>
647 Warn_On_Modified_Unread := False;
649 when 'n' =>
650 Warning_Mode := Normal;
652 when 'o' =>
653 Address_Clause_Overlay_Warnings := True;
655 when 'O' =>
656 Address_Clause_Overlay_Warnings := False;
658 when 'p' =>
659 Ineffective_Inline_Warnings := True;
661 when 'P' =>
662 Ineffective_Inline_Warnings := False;
664 when 'q' =>
665 Warn_On_Questionable_Missing_Parens := True;
667 when 'Q' =>
668 Warn_On_Questionable_Missing_Parens := False;
670 when 'r' =>
671 Warn_On_Redundant_Constructs := True;
673 when 'R' =>
674 Warn_On_Redundant_Constructs := False;
676 when 's' =>
677 Warning_Mode := Suppress;
679 when 't' =>
680 Warn_On_Deleted_Code := True;
682 when 'T' =>
683 Warn_On_Deleted_Code := False;
685 when 'u' =>
686 Check_Unreferenced := True;
687 Check_Withs := True;
688 Check_Unreferenced_Formals := True;
690 when 'U' =>
691 Check_Unreferenced := False;
692 Check_Withs := False;
693 Check_Unreferenced_Formals := False;
695 when 'v' =>
696 Warn_On_No_Value_Assigned := True;
698 when 'V' =>
699 Warn_On_No_Value_Assigned := False;
701 when 'w' =>
702 Warn_On_Assumed_Low_Bound := True;
704 when 'W' =>
705 Warn_On_Assumed_Low_Bound := False;
707 when 'x' =>
708 Warn_On_Export_Import := True;
710 when 'X' =>
711 Warn_On_Export_Import := False;
713 when 'y' =>
714 Warn_On_Ada_2005_Compatibility := True;
715 Warn_On_Ada_2012_Compatibility := True;
717 when 'Y' =>
718 Warn_On_Ada_2005_Compatibility := False;
719 Warn_On_Ada_2012_Compatibility := False;
721 when 'z' =>
722 Warn_On_Unchecked_Conversion := True;
724 when 'Z' =>
725 Warn_On_Unchecked_Conversion := False;
727 when others =>
728 if Ignore_Unrecognized_VWY_Switches then
729 Write_Line ("unrecognized switch -gnatw" & C & " ignored");
730 else
731 return False;
732 end if;
733 end case;
735 return True;
736 end Set_Warning_Switch;
738 -----------------
739 -- WA_Warnings --
740 -----------------
742 procedure WA_Warnings is
743 begin
744 Check_Unreferenced := True; -- -gnatwf/-gnatwu
745 Check_Unreferenced_Formals := True; -- -gnatwf/-gnatwu
746 Check_Withs := True; -- -gnatwu
747 Constant_Condition_Warnings := True; -- -gnatwc
748 Implementation_Unit_Warnings := True; -- -gnatwi
749 Ineffective_Inline_Warnings := True; -- -gnatwp
750 Warn_On_Ada_2005_Compatibility := True; -- -gnatwy
751 Warn_On_Ada_2012_Compatibility := True; -- -gnatwy
752 Warn_On_Anonymous_Allocators := True; -- -gnatw_a
753 Warn_On_Assertion_Failure := True; -- -gnatw.a
754 Warn_On_Assumed_Low_Bound := True; -- -gnatww
755 Warn_On_Bad_Fixed_Value := True; -- -gnatwb
756 Warn_On_Biased_Representation := True; -- -gnatw.b
757 Warn_On_Constant := True; -- -gnatwk
758 Warn_On_Export_Import := True; -- -gnatwx
759 Warn_On_Late_Primitives := True; -- -gnatw.j
760 Warn_On_Modified_Unread := True; -- -gnatwm
761 Warn_On_No_Value_Assigned := True; -- -gnatwv
762 Warn_On_Non_Local_Exception := True; -- -gnatw.x
763 Warn_On_Object_Renames_Function := True; -- -gnatw.r
764 Warn_On_Obsolescent_Feature := True; -- -gnatwj
765 Warn_On_Overlap := True; -- -gnatw.i
766 Warn_On_Parameter_Order := True; -- -gnatw.p
767 Warn_On_Questionable_Missing_Parens := True; -- -gnatwq
768 Warn_On_Redundant_Constructs := True; -- -gnatwr
769 Warn_On_Reverse_Bit_Order := True; -- -gnatw.v
770 Warn_On_Size_Alignment := True; -- -gnatw.z
771 Warn_On_Suspicious_Contract := True; -- -gnatw.t
772 Warn_On_Suspicious_Modulus_Value := True; -- -gnatw.m
773 Warn_On_Unchecked_Conversion := True; -- -gnatwz
774 Warn_On_Unrecognized_Pragma := True; -- -gnatwg
775 Warn_On_Unrepped_Components := True; -- -gnatw.c
776 end WA_Warnings;
778 end Warnsw;