1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
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. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
27 with ALI
.Util
; use ALI
.Util
;
28 with Bcheck
; use Bcheck
;
29 with Binde
; use Binde
;
30 with Binderr
; use Binderr
;
31 with Bindgen
; use Bindgen
;
33 with Butil
; use Butil
;
34 with Casing
; use Casing
;
36 with Debug
; use Debug
;
38 with Fname
; use Fname
;
39 with Namet
; use Namet
;
41 with Osint
; use Osint
;
42 with Osint
.B
; use Osint
.B
;
43 with Output
; use Output
;
44 with Rident
; use Rident
;
46 with Switch
; use Switch
;
47 with Switch
.B
; use Switch
.B
;
49 with Targparm
; use Targparm
;
50 with Types
; use Types
;
52 with System
.Case_Util
; use System
.Case_Util
;
53 with System
.OS_Lib
; use System
.OS_Lib
;
55 with Ada
.Command_Line
.Response_File
; use Ada
.Command_Line
;
59 Total_Errors
: Nat
:= 0;
60 -- Counts total errors in all files
62 Total_Warnings
: Nat
:= 0;
63 -- Total warnings in all files
65 Main_Lib_File
: File_Name_Type
;
66 -- Current main library file
68 First_Main_Lib_File
: File_Name_Type
:= No_File
;
69 -- The first library file, that should be a main subprogram if neither -n
72 Std_Lib_File
: File_Name_Type
;
75 Text
: Text_Buffer_Ptr
;
77 Output_File_Name_Seen
: Boolean := False;
78 Output_File_Name
: String_Ptr
:= new String'("");
80 Mapping_File : String_Ptr := null;
82 package Closure_Sources is new Table.Table
83 (Table_Component_Type => File_Name_Type,
84 Table_Index_Type => Natural,
87 Table_Increment => 100,
88 Table_Name => "Gnatbind.Closure_Sources");
89 -- Table to record the sources in the closure, to avoid duplications. Used
90 -- only with switch -R.
92 procedure Add_Artificial_ALI_File (Name : String);
93 -- Artificially add ALI file Name in the closure
95 function Gnatbind_Supports_Auto_Init return Boolean;
96 -- Indicates if automatic initialization of elaboration procedure
97 -- through the constructor mechanism is possible on the platform.
99 procedure List_Applicable_Restrictions;
100 -- List restrictions that apply to this partition if option taken
102 procedure Scan_Bind_Arg (Argv : String);
103 -- Scan and process binder specific arguments. Argv is a single argument.
104 -- All the one character arguments are still handled by Switch. This
105 -- routine handles -aO -aI and -I-. The lower bound of Argv must be 1.
108 with procedure Action (Argv : String);
109 procedure Generic_Scan_Bind_Args;
110 -- Iterate through the args calling Action on each one, taking care of
113 procedure Write_Arg (S : String);
114 -- Passed to Generic_Scan_Bind_Args to print args
116 function Is_Cross_Compiler return Boolean;
117 -- Returns True iff this is a cross-compiler
119 -----------------------------
120 -- Add_Artificial_ALI_File --
121 -----------------------------
123 procedure Add_Artificial_ALI_File (Name : String) is
125 pragma Warnings (Off, Id);
128 Name_Len := Name'Length;
129 Name_Buffer (1 .. Name_Len) := Name;
130 Std_Lib_File := Name_Find;
131 Text := Read_Library_Info (Std_Lib_File, True);
139 Ignore_Errors => Debug_Flag_I);
142 end Add_Artificial_ALI_File;
144 ---------------------------------
145 -- Gnatbind_Supports_Auto_Init --
146 ---------------------------------
148 function Gnatbind_Supports_Auto_Init return Boolean is
149 function gnat_binder_supports_auto_init return Integer;
150 pragma Import (C, gnat_binder_supports_auto_init,
151 "__gnat_binder_supports_auto_init");
153 return gnat_binder_supports_auto_init /= 0;
154 end Gnatbind_Supports_Auto_Init;
156 -----------------------
157 -- Is_Cross_Compiler --
158 -----------------------
160 function Is_Cross_Compiler return Boolean is
161 Cross_Compiler : Integer;
162 pragma Import (C, Cross_Compiler, "__gnat_is_cross_compiler");
164 return Cross_Compiler = 1;
165 end Is_Cross_Compiler;
167 ----------------------------------
168 -- List_Applicable_Restrictions --
169 ----------------------------------
171 procedure List_Applicable_Restrictions is
173 -- Define those restrictions that should be output if the gnatbind
174 -- -r switch is used. Not all restrictions are output for the reasons
175 -- given below in the list, and this array is used to test whether
176 -- the corresponding pragma should be listed. True means that it
177 -- should not be listed.
179 No_Restriction_List : constant array (All_Restrictions) of Boolean :=
180 (No_Standard_Allocators_After_Elaboration => True,
181 -- This involves run-time conditions not checkable at compile time
183 No_Anonymous_Allocators => True,
184 -- Premature, since we have not implemented this yet
186 No_Exception_Propagation => True,
187 -- Modifies code resulting in different exception semantics
189 No_Exceptions => True,
190 -- Has unexpected Suppress (All_Checks) effect
192 No_Implicit_Conditionals => True,
193 -- This could modify and pessimize generated code
195 No_Implicit_Dynamic_Code => True,
196 -- This could modify and pessimize generated code
198 No_Implicit_Loops => True,
199 -- This could modify and pessimize generated code
201 No_Recursion => True,
202 -- Not checkable at compile time
204 No_Reentrancy => True,
205 -- Not checkable at compile time
207 Max_Entry_Queue_Length => True,
208 -- Not checkable at compile time
210 Max_Storage_At_Blocking => True,
211 -- Not checkable at compile time
213 -- The following three should not be partition-wide, so the
214 -- following tests are junk to be removed eventually ???
216 No_Specification_Of_Aspect => True,
217 -- Requires a parameter value, not a count
219 No_Use_Of_Attribute => True,
220 -- Requires a parameter value, not a count
222 No_Use_Of_Pragma => True,
223 -- Requires a parameter value, not a count
227 Additional_Restrictions_Listed : Boolean := False;
228 -- Set True if we have listed header for restrictions
230 function Restriction_Could_Be_Set (R : Restriction_Id) return Boolean;
231 -- Returns True if the given restriction can be listed as an additional
232 -- restriction that could be set.
234 ------------------------------
235 -- Restriction_Could_Be_Set --
236 ------------------------------
238 function Restriction_Could_Be_Set (R : Restriction_Id) return Boolean is
239 CR : Restrictions_Info renames Cumulative_Restrictions;
244 -- Boolean restriction
246 when All_Boolean_Restrictions =>
248 -- The condition for listing a boolean restriction as an
249 -- additional restriction that could be set is that it is
250 -- not violated by any unit, and not already set.
252 return CR.Violated (R) = False and then CR.Set (R) = False;
254 -- Parameter restriction
256 when All_Parameter_Restrictions =>
258 -- If the restriction is violated and the level of violation is
259 -- unknown, the restriction can definitely not be listed.
261 if CR.Violated (R) and then CR.Unknown (R) then
264 -- We can list the restriction if it is not set
266 elsif not CR.Set (R) then
269 -- We can list the restriction if is set to a greater value
270 -- than the maximum value known for the violation.
273 return CR.Value (R) > CR.Count (R);
276 -- No other values for R possible
282 end Restriction_Could_Be_Set;
284 -- Start of processing for List_Applicable_Restrictions
287 -- Loop through restrictions
289 for R in All_Restrictions loop
290 if not No_Restriction_List (R)
291 and then Restriction_Could_Be_Set (R)
293 if not Additional_Restrictions_Listed then
296 ("The following additional restrictions may be" &
297 " applied to this partition:");
298 Additional_Restrictions_Listed := True;
301 Write_Str ("pragma Restrictions (");
304 S : constant String := Restriction_Id'Image (R);
306 Name_Len := S'Length;
307 Name_Buffer (1 .. Name_Len) := S;
310 Set_Casing (Mixed_Case);
311 Write_Str (Name_Buffer (1 .. Name_Len));
313 if R in All_Parameter_Restrictions then
315 Write_Int (Int (Cumulative_Restrictions.Count (R)));
322 end List_Applicable_Restrictions;
328 procedure Scan_Bind_Arg (Argv : String) is
329 pragma Assert (Argv'First = 1);
332 -- Now scan arguments that are specific to the binder and are not
333 -- handled by the common circuitry in Switch.
335 if Opt.Output_File_Name_Present
336 and then not Output_File_Name_Seen
338 Output_File_Name_Seen := True;
341 or else (Argv'Length >= 1 and then Argv (1) = '-')
343 Fail ("output File_Name missing after -o");
346 Output_File_Name := new String'(Argv
);
349 elsif Argv
'Length >= 2 and then Argv
(1) = '-' then
353 if Argv
(2 .. Argv
'Last) = "I-" then
354 Opt
.Look_In_Primary_Dir
:= False;
358 elsif Argv
(2) = 'I' then
359 Add_Src_Search_Dir
(Argv
(3 .. Argv
'Last));
360 Add_Lib_Search_Dir
(Argv
(3 .. Argv
'Last));
364 elsif Argv
(2) = 'L' then
365 if Argv
'Length >= 3 then
367 Opt
.Bind_For_Library
:= True;
369 new String'(Argv (3 .. Argv'Last) & Opt.Ada_Init_Suffix);
370 Opt.Ada_Final_Name :=
371 new String'(Argv
(3 .. Argv
'Last) & Opt
.Ada_Final_Suffix
);
373 new String'(Argv (3 .. Argv'Last) & Opt.Ada_Main_Name_Suffix);
375 -- This option (-Lxxx) implies -n
377 Opt.Bind_Main_Program := False;
381 ("Prefix of initialization and finalization " &
382 "procedure names missing in -L");
385 -- -Sin -Slo -Shi -Sxx -Sev
387 elsif Argv'Length = 4
388 and then Argv (2) = 'S
'
391 C1 : Character := Argv (3);
392 C2 : Character := Argv (4);
395 -- Fold to upper case
397 if C1 in 'a
' .. 'z
' then
398 C1 := Character'Val (Character'Pos (C1) - 32);
401 if C2 in 'a
' .. 'z
' then
402 C2 := Character'Val (Character'Pos (C2) - 32);
405 -- Test valid option and set mode accordingly
407 if C1 = 'E
' and then C2 = 'V
' then
410 elsif C1 = 'I
' and then C2 = 'N
' then
413 elsif C1 = 'L
' and then C2 = 'O
' then
416 elsif C1 = 'H
' and then C2 = 'I
' then
419 elsif (C1 in '0' .. '9' or else C1 in 'A
' .. 'F
')
421 (C2 in '0' .. '9' or else C2 in 'A
' .. 'F
')
425 -- Invalid -S switch, let Switch give error, set default of IN
428 Scan_Binder_Switches (Argv);
433 Initialize_Scalars_Mode1 := C1;
434 Initialize_Scalars_Mode2 := C2;
439 elsif Argv'Length >= 3
440 and then Argv (2 .. 3) = "aI"
442 Add_Src_Search_Dir (Argv (4 .. Argv'Last));
446 elsif Argv'Length >= 3
447 and then Argv (2 .. 3) = "aO"
449 Add_Lib_Search_Dir (Argv (4 .. Argv'Last));
453 elsif Argv (2 .. Argv'Last) = "nostdlib" then
454 Opt.No_Stdlib := True;
458 elsif Argv (2 .. Argv'Last) = "nostdinc" then
459 Opt.No_Stdinc := True;
463 elsif Argv (2 .. Argv'Last) = "static" then
464 Opt.Shared_Libgnat := False;
468 elsif Argv (2 .. Argv'Last) = "shared" then
469 Opt.Shared_Libgnat := True;
473 elsif Argv'Length >= 4 and then Argv (2 .. 3) = "F=" then
474 if Mapping_File /= null then
475 Fail ("cannot specify several mapping files");
478 Mapping_File := new String'(Argv
(4 .. Argv
'Last));
482 elsif Argv
'Length >= 3 and then Argv
(2) = 'M' then
483 if not Is_Cross_Compiler
then
485 ("gnatbind: -M not expected to be used on native platforms");
488 Opt
.Bind_Alternate_Main_Name
:= True;
489 Opt
.Alternate_Main_Name
:= new String'(Argv (3 .. Argv'Last));
491 -- All other options are single character and are handled by
492 -- Scan_Binder_Switches.
495 Scan_Binder_Switches (Argv);
498 -- Not a switch, so must be a file name (if non-empty)
500 elsif Argv'Length /= 0 then
502 and then Argv (Argv'Last - 3 .. Argv'Last) = ".ali"
506 Add_File (Argv & ".ali");
511 ----------------------------
512 -- Generic_Scan_Bind_Args --
513 ----------------------------
515 procedure Generic_Scan_Bind_Args is
516 Next_Arg : Positive := 1;
519 -- Use low level argument routines to avoid dragging in secondary stack
521 while Next_Arg < Arg_Count loop
523 Next_Argv : String (1 .. Len_Arg (Next_Arg));
526 Fill_Arg (Next_Argv'Address, Next_Arg);
528 if Next_Argv'Length > 0 then
529 if Next_Argv (1) = '@
' then
530 if Next_Argv'Length > 1 then
532 Arguments : constant Argument_List :=
533 Response_File.Arguments_From
534 (Response_File_Name =>
535 Next_Argv (2 .. Next_Argv'Last),
537 Ignore_Non_Existing_Files => True);
539 for J in Arguments'Range loop
540 Action (Arguments (J).all);
551 Next_Arg := Next_Arg + 1;
553 end Generic_Scan_Bind_Args;
559 procedure Write_Arg (S : String) is
564 procedure Scan_Bind_Args is new Generic_Scan_Bind_Args (Scan_Bind_Arg);
565 procedure Put_Bind_Args is new Generic_Scan_Bind_Args (Write_Arg);
567 procedure Check_Version_And_Help is
568 new Check_Version_And_Help_G (Bindusg.Display);
570 -- Start of processing for Gnatbind
573 -- Set default for Shared_Libgnat option
576 Shared_Libgnat_Default : Character;
578 (C, Shared_Libgnat_Default, "__gnat_shared_libgnat_default");
580 SHARED : constant Character := 'H
';
581 STATIC : constant Character := 'T
';
585 (Shared_Libgnat_Default = SHARED
587 Shared_Libgnat_Default = STATIC);
588 Shared_Libgnat := (Shared_Libgnat_Default = SHARED);
591 -- Carry out package initializations. These are initializations which
592 -- might logically be performed at elaboration time, and we decide to be
593 -- consistent. Like elaboration, the order in which these calls are made
594 -- is in some cases important.
599 -- Scan the switches and arguments. Note that Snames must already be
600 -- initialized (for processing of the -V switch).
602 -- First, scan to detect --version and/or --help
604 Check_Version_And_Help ("GNATBIND", "1992");
606 -- We need to Scan_Bind_Args first, to set Verbose_Mode, so we know whether
612 Write_Str (Command_Name);
617 if Use_Pragma_Linker_Constructor then
618 if Bind_Main_Program then
619 Fail ("switch -a must be used in conjunction with -n or -Lxxx");
621 elsif not Gnatbind_Supports_Auto_Init then
622 Fail ("automatic initialisation of elaboration " &
623 "not supported on this platform");
627 -- Test for trailing -o switch
629 if Opt.Output_File_Name_Present and then not Output_File_Name_Seen then
630 Fail ("output file name missing after -o");
633 -- Output usage if requested
635 if Usage_Requested then
639 -- Check that the binder file specified has extension .adb
641 if Opt.Output_File_Name_Present and then Output_File_Name_Seen then
642 Check_Extensions : declare
643 Length : constant Natural := Output_File_Name'Length;
644 Last : constant Natural := Output_File_Name'Last;
647 or else Output_File_Name (Last - 3 .. Last) /= ".adb"
649 Fail ("output file name should have .adb extension");
651 end Check_Extensions;
654 Osint.Add_Default_Search_Dirs;
656 -- Acquire target parameters
658 Targparm.Get_Target_Parameters;
660 -- Initialize Cumulative_Restrictions with the restrictions on the target
661 -- scanned from the system.ads file. Then as we read ALI files, we will
662 -- accumulate additional restrictions specified in other files.
664 Cumulative_Restrictions := Targparm.Restrictions_On_Target;
666 -- Acquire configurable run-time mode
668 if Configurable_Run_Time_On_Target then
669 Configurable_Run_Time_Mode := True;
672 -- Output copyright notice if in verbose mode
676 Display_Version ("GNATBIND", "1995");
679 -- Output usage information if no arguments
681 if not More_Lib_Files then
682 if Argument_Count = 0 then
685 Write_Line ("try ""gnatbind --help"" for more information.");
688 Exit_Program (E_Fatal);
691 -- If a mapping file was specified, initialize the file mapping
693 if Mapping_File /= null then
694 Fmap.Initialize (Mapping_File.all);
697 -- The block here is to catch the Unrecoverable_Error exception in the
698 -- case where we exceed the maximum number of permissible errors or some
699 -- other unrecoverable error occurs.
702 -- Initialize binder packages
706 Initialize_ALI_Source;
714 while More_Lib_Files loop
715 Main_Lib_File := Next_Main_Lib_File;
717 if First_Main_Lib_File = No_File then
718 First_Main_Lib_File := Main_Lib_File;
723 Write_Str ("Checking: ");
725 Write_Str ("Binding: ");
728 Write_Name (Main_Lib_File);
732 Text := Read_Library_Info (Main_Lib_File, True);
736 pragma Warnings (Off, Id);
744 Ignore_Errors => Debug_Flag_I,
745 Directly_Scanned => True);
753 if No_Run_Time_Mode then
755 -- Set standard configuration parameters
757 Suppress_Standard_Library_On_Target := True;
758 Configurable_Run_Time_Mode := True;
761 -- For main ALI files, even if they are interfaces, we get their
762 -- dependencies. To be sure, we reset the Interface flag for all main
765 for Index in ALIs.First .. ALIs.Last loop
766 ALIs.Table (Index).SAL_Interface := False;
769 -- Add System.Standard_Library to list to ensure that these files are
770 -- included in the bind, even if not directly referenced from Ada code
771 -- This is suppressed if the appropriate targparm switch is set. Be sure
772 -- in any case that System is in the closure, as it may contains linker
773 -- options. Note that it will be automatically added if s-stalib is
776 if not Suppress_Standard_Library_On_Target then
777 Add_Artificial_ALI_File ("s-stalib.ali");
779 Add_Artificial_ALI_File ("system.ali");
782 -- Load ALIs for all dependent units
784 for Index in ALIs.First .. ALIs.Last loop
785 Read_Withed_ALIs (Index);
788 -- Quit if some file needs compiling
790 if No_Object_Specified then
791 raise Unrecoverable_Error;
794 -- Quit with message if we had a GNATprove file
796 if GNATprove_Mode_Specified then
797 Error_Msg ("one or more files compiled in GNATprove mode");
798 raise Unrecoverable_Error;
801 -- Output list of ALI files in closure
803 if Output_ALI_List then
804 if ALI_List_Filename /= null then
805 Set_List_File (ALI_List_Filename.all);
808 for Index in ALIs.First .. ALIs.Last loop
810 Full_Afile : constant File_Name_Type :=
811 Find_File (ALIs.Table (Index).Afile, Library);
813 Write_Name (Full_Afile);
818 if ALI_List_Filename /= null then
823 -- Build source file table from the ALI files we have read in
827 -- If there is main program to bind, set Main_Lib_File to the first
828 -- library file, and the name from which to derive the binder generate
829 -- file to the first ALI file.
831 if Bind_Main_Program then
832 Main_Lib_File := First_Main_Lib_File;
833 Set_Current_File_Name_Index (To => 1);
836 -- Check that main library file is a suitable main program
839 and then ALIs.Table (ALIs.First).Main_Program = None
840 and then not No_Main_Subprogram
843 (Units.Table (ALIs.Table (ALIs.First).First_Unit).Uname);
846 Unit_Name : String := Name_Buffer (1 .. Name_Len - 2);
848 To_Mixed (Unit_Name);
849 Get_Name_String (ALIs.Table (ALIs.First).Sfile);
850 Add_Str_To_Name_Buffer (":1: ");
851 Add_Str_To_Name_Buffer (Unit_Name);
852 Add_Str_To_Name_Buffer (" cannot be used as a main program");
853 Write_Line (Name_Buffer (1 .. Name_Len));
854 Errors_Detected := Errors_Detected + 1;
858 -- Perform consistency and correctness checks. Disable these in CodePeer
859 -- mode where we want to be more flexible.
861 if not CodePeer_Mode then
862 Check_Duplicated_Subunits;
865 Check_Configuration_Consistency;
868 -- List restrictions that could be applied to this partition
870 if List_Restrictions then
871 List_Applicable_Restrictions;
874 -- Complete bind if no errors
876 if Errors_Detected = 0 then
879 if Errors_Detected = 0 then
880 -- Display elaboration order if -l was specified
882 if Elab_Order_Output then
883 if not Zero_Formatting then
885 Write_Str ("ELABORATION ORDER");
889 for J in Elab_Order.First .. Elab_Order.Last loop
890 if not Units.Table (Elab_Order.Table (J)).SAL_Interface then
891 if not Zero_Formatting then
896 (Units.Table (Elab_Order.Table (J)).Uname);
901 if not Zero_Formatting then
906 if not Check_Only then
907 Gen_Output_File (Output_File_Name.all);
910 -- Display list of sources in the closure (except predefined
911 -- sources) if -R was used.
914 List_Closure_Display : declare
915 Source : File_Name_Type;
917 function Put_In_Sources (S : File_Name_Type) return Boolean;
918 -- Check if S is already in table Sources and put in Sources
919 -- if it is not. Return False if the source is already in
920 -- Sources, and True if it is added.
926 function Put_In_Sources
927 (S : File_Name_Type) return Boolean
930 for J in 1 .. Closure_Sources.Last loop
931 if Closure_Sources.Table (J) = S then
936 Closure_Sources.Append (S);
940 -- Start of processing for List_Closure_Display
943 Closure_Sources.Init;
945 if not Zero_Formatting then
947 Write_Str ("REFERENCED SOURCES");
951 for J in reverse Elab_Order.First .. Elab_Order.Last loop
952 Source := Units.Table (Elab_Order.Table (J)).Sfile;
954 -- Do not include same source more than once
956 if Put_In_Sources (Source)
958 -- Do not include run-time units unless -Ra switch set
960 and then (List_Closure_All
961 or else not Is_Internal_File_Name (Source))
963 if not Zero_Formatting then
967 Write_Str (Get_Name_String (Source));
972 -- Subunits do not appear in the elaboration table because
973 -- they are subsumed by their parent units, but we need to
974 -- list them for other tools. For now they are listed after
975 -- other files, rather than right after their parent, since
976 -- there is no easy link between the elaboration table and
977 -- the ALIs table ??? As subunits may appear repeatedly in
978 -- the list, if the parent unit appears in the context of
979 -- several units in the closure, duplicates are suppressed.
981 for J in Sdep.First .. Sdep.Last loop
982 Source := Sdep.Table (J).Sfile;
984 if Sdep.Table (J).Subunit_Name /= No_Name
985 and then Put_In_Sources (Source)
986 and then not Is_Internal_File_Name (Source)
988 if not Zero_Formatting then
992 Write_Str (Get_Name_String (Source));
997 if not Zero_Formatting then
1000 end List_Closure_Display;
1005 Total_Errors := Total_Errors + Errors_Detected;
1006 Total_Warnings := Total_Warnings + Warnings_Detected;
1009 when Unrecoverable_Error =>
1010 Total_Errors := Total_Errors + Errors_Detected;
1011 Total_Warnings := Total_Warnings + Warnings_Detected;
1014 -- All done. Set proper exit status
1019 if Total_Errors > 0 then
1020 Exit_Program (E_Errors);
1022 elsif Total_Warnings > 0 then
1023 Exit_Program (E_Warnings);
1026 -- Do not call Exit_Program (E_Success), so that finalization occurs