This patch prepares to move warning switches from Opt into Warnsw.
gcc/ada/
* warnsw.ads, warnsw.adb, fe.h, err_vars.ads, errout.ads: Move
Warning_Doc_Switch from Err_Vars to Warnsw. Access
Warn_On_Questionable_Layout on the C side via a function rather
than a variable, because we plan to turn the variables into
renamings, and you can't Export renamings.
* erroutc.adb, switch-c.adb, errout.adb: Likewise.
* gcc-interface/decl.cc: Use Get_Warn_On_Questionable_Layout
instead of Warn_On_Questionable_Layout.
* gcc-interface/Makefile.in (GNATMAKE_OBJS): Add warnsw.o, because
it is indirectly imported via Errout.
* gcc-interface/Make-lang.in (GNATBIND_OBJS): Likewise and remove
restrict.o (not needed).
-- Source_Reference line, then this is initialized to No_Source_File,
-- to force an initial reference to the real source file name.
- Warning_Doc_Switch : Boolean := True;
- -- If this is set True, then the ??/?x?/?x? sequences in error messages
- -- are active (see errout.ads for details). If this switch is False, then
- -- these sequences are ignored (i.e. simply equivalent to a single ?). The
- -- -gnatw.d switch sets this flag True, -gnatw.D sets this flag False.
-
----------------------------------------
-- Error Message Insertion Parameters --
----------------------------------------
with Stylesw; use Stylesw;
with System.OS_Lib;
with Uname; use Uname;
+with Warnsw; pragma Unreferenced (Warnsw);
+-- Will be referenced when various flags are moved to Warnsw.
package body Errout is
Error_Msg_Exception : exception renames Err_Vars.Error_Msg_Exception;
-- Exception raised if Raise_Exception_On_Error is true
- Warning_Doc_Switch : Boolean renames Err_Vars.Warning_Doc_Switch;
- -- If this is set True, then the ??/?*?/?$?/?x?/?.x?/?_x? insertion
- -- sequences in error messages generate appropriate tags for the output
- -- error messages. If this switch is False, then these sequences are still
- -- recognized (for the purposes of implementing the pattern matching in
- -- pragmas Warnings (Off,..) and Warning_As_Error(...) but do not result
- -- in adding the error message tag. The -gnatw.d switch sets this flag
- -- True, -gnatw.D sets this flag False.
-
Current_Node : Node_Id := Empty;
-- Used by Error_Msg as a default Node_Id.
-- Relevant only when Opt.Include_Subprogram_In_Messages is set.
with Targparm;
with Uintp; use Uintp;
with Widechar; use Widechar;
+with Warnsw; use Warnsw;
package body Erroutc is
/* warnsw: */
-#define Warn_On_Questionable_Layout warnsw__warn_on_questionable_layout
+#define Get_Warn_On_Questionable_Layout warnsw__get_warn_on_questionable_layout
-extern Boolean Warn_On_Questionable_Layout;
+extern Boolean Get_Warn_On_Questionable_Layout ();
// The following corresponds to Ada code in Einfo.Utils.
ada/osint-b.o \
ada/osint.o \
ada/output.o \
- ada/restrict.o \
ada/rident.o \
ada/scans.o \
ada/scil_ll.o \
ada/uintp.o \
ada/uname.o \
ada/urealp.o \
+ ada/warnsw.o \
ada/widechar.o \
ada/gnat.o \
ada/g-dynhta.o \
s-purexc.o s-htable.o scil_ll.o sem_aux.o sinfo.o sinput.o sinput-c.o \
snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o \
switch.o switch-m.o table.o targparm.o tempdir.o types.o uintp.o \
- uname.o urealp.o usage.o widechar.o \
+ uname.o urealp.o usage.o widechar.o warnsw.o \
seinfo.o einfo-entities.o einfo-utils.o sinfo-nodes.o sinfo-utils.o \
$(EXTRA_GNATMAKE_OBJS)
&& !Debug_Flag_Dot_R);
const bool w_reorder
= (Convention (gnat_record_type) == Convention_Ada
- && Warn_On_Questionable_Layout
+ && Get_Warn_On_Questionable_Layout ()
&& !(No_Reordering (gnat_record_type) && GNAT_Mode));
tree gnu_zero_list = NULL_TREE;
tree gnu_self_list = NULL_TREE;
-- circularities, especially for back ends using Adabkend.
with Debug; use Debug;
-with Errout; use Errout;
with Lib; use Lib;
with Osint; use Osint;
with Opt; use Opt;
-- --
------------------------------------------------------------------------------
-with Err_Vars; use Err_Vars;
with Opt; use Opt;
with Output; use Output;
-- here as time goes by. And in fact a really nice idea would be to put
-- them all in a Warn_Record so that they would be easy to save/restore.
+ Warning_Doc_Switch : Boolean := True;
+ -- If this is set True, then the ??/?*?/?$?/?x?/?.x?/?_x? insertion
+ -- sequences in error messages generate appropriate tags for the output
+ -- error messages. If this switch is False, then these sequences are still
+ -- recognized (for the purposes of implementing the pattern matching in
+ -- pragmas Warnings (Off,..) and Warning_As_Error(...) but do not result
+ -- in adding the error message tag. The -gnatw.d switch sets this flag
+ -- True, -gnatw.D sets this flag False.
+
Warn_On_Anonymous_Allocators : Boolean := False;
-- Warn when allocators for anonymous access types are present, which,
-- although not illegal in Ada, may be confusing to users due to how
-- efficiency reasons and would be improved by reordering the components.
-- Off by default, modified by use of -gnatw.q/.Q (but not -gnatwa).
- -- WARNING: There is a matching C declaration of this variable in fe.h
+ function Get_Warn_On_Questionable_Layout return Boolean is
+ (Warn_On_Questionable_Layout);
+ -- WARNING: There is a matching C declaration of this function in fe.h
Warn_On_Record_Holes : Boolean := False;
-- Warn when explicit record component clauses leave uncovered holes (gaps)