[multiple changes]
[gcc.git] / gcc / ada / warnsw.ads
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-2012, 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 ------------------------------------------------------------------------------
25
26 -- This unit contains the routines used to handle setting of warning options
27
28 package Warnsw is
29
30 -------------------
31 -- Warning Flags --
32 -------------------
33
34 -- These flags are activated or deactivated by -gnatw switches and control
35 -- whether warnings of a given class will be generated or not.
36
37 -- Note: most of these flags are still in opt, but the plan is to move them
38 -- here as time goes by.
39
40 Warn_On_Record_Holes : Boolean := False;
41 -- Warn when explicit record component clauses leave uncovered holes (gaps)
42 -- in a record layout. Off by default, set by -gnatw.h (but not -gnatwa).
43
44 Warn_On_Overridden_Size : Boolean := False;
45 -- Warn when explicit record component clause or array component_size
46 -- clause specifies a size that overrides a size for the typen which was
47 -- set with an explicit size clause. Off by default, set by -gnatw.s (but
48 -- not -gnatwa).
49
50 Warn_On_Standard_Redefinition : Boolean := False;
51 -- Warn when a program defines an identifier that matches a name in
52 -- Standard. Off by default, set by -gnatw.k (and also by -gnatwa).
53
54 -----------------
55 -- Subprograms --
56 -----------------
57
58 function Set_Warning_Switch (C : Character) return Boolean;
59 -- This function sets the warning switch or switches corresponding to the
60 -- given character. It is used to process a -gnatw switch on the command
61 -- line, or a character in a string literal in pragma Warnings. Returns
62 -- True for valid warning character C, False for invalid character.
63
64 function Set_Dot_Warning_Switch (C : Character) return Boolean;
65 -- This function sets the warning switch or switches corresponding to the
66 -- given character preceded by a dot. Used to process a -gnatw. switch on
67 -- the command line or .C in a string literal in pragma Warnings. Returns
68 -- True for valid warning character C, False for invalid character.
69
70 procedure Set_GNAT_Mode_Warnings;
71 -- This is called in -gnatg mode to set the warnings for gnat mode. It is
72 -- also used to set the proper warning statuses for -gnatw.g. Note that
73 -- this set of warnings is disjoint from -gnatwa, it enables warnings that
74 -- are not included in -gnatwa, and it disables warnings that are included
75 -- in -gnatwa (such as Warn_On_Implementation_Units, which we clearly want
76 -- to be False for units built with -gnatg).
77
78 end Warnsw;