Commit fdacd614 by Philippe Gil Committed by Pierre-Marie de Rodat

[Ada] Initialize gnat_argc/gnat_argv only the first time

2019-08-20  Philippe Gil  <gil@adacore.com>

gcc/ada/

	* bindgen.adb (Gen_Main): Set gnat_argc/gnat_argv to argc/argv
	only when still uninitialized.

From-SVN: r274716
parent e1976249
2019-08-20 Philippe Gil <gil@adacore.com>
* bindgen.adb (Gen_Main): Set gnat_argc/gnat_argv to argc/argv
only when still uninitialized.
2019-08-20 Bob Duff <duff@adacore.com>
* libgnat/g-comlin.ads (Exit_From_Command_Line): Fix
......
......@@ -1826,18 +1826,25 @@ package body Bindgen is
WBI (" begin");
-- Acquire command line arguments if present on target
-- Acquire command-line arguments if present on target
if CodePeer_Mode then
null;
elsif Command_Line_Args_On_Target then
WBI (" gnat_argc := argc;");
WBI (" gnat_argv := argv;");
-- Initialize gnat_argc/gnat_argv only if not already initialized,
-- to avoid losing the result of any command-line processing done by
-- earlier GNAT run-time initialization.
WBI (" if gnat_argc = 0 then");
WBI (" gnat_argc := argc;");
WBI (" gnat_argv := argv;");
WBI (" end if;");
WBI (" gnat_envp := envp;");
WBI ("");
-- If configurable run time and no command line args, then nothing needs
-- If configurable run-time and no command-line args, then nothing needs
-- to be done since the gnat_argc/argv/envp variables are suppressed in
-- this case.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment