Commit fce68ebe by Arnaud Charlet

[multiple changes]

2013-04-11  Robert Dewar  <dewar@adacore.com>

	* sem_prag.adb, prj-env.adb: Minor reformatting.

2013-04-11  Ben Brosgol  <brosgol@adacore.com>

	* gnat_ugn.texi: Clean ups.

2013-04-11  Yannick Moy  <moy@adacore.com>

	* set_targ.adb: Minor comment update.

From-SVN: r197798
parent e2441021
2013-04-11 Robert Dewar <dewar@adacore.com>
* sem_prag.adb, prj-env.adb: Minor reformatting.
2013-04-11 Ben Brosgol <brosgol@adacore.com>
* gnat_ugn.texi: Clean ups.
2013-04-11 Yannick Moy <moy@adacore.com>
* set_targ.adb: Minor comment update.
2013-04-11 Pascal Obry <obry@adacore.com> 2013-04-11 Pascal Obry <obry@adacore.com>
* gnat_ugn.texi: Remove obsolete comment about DLL calling * gnat_ugn.texi: Remove obsolete comment about DLL calling
......
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with Ada.Text_IO; use Ada.Text_IO;
with Fmap; with Fmap;
with Hostparm; with Hostparm;
with Makeutl; use Makeutl; with Makeutl; use Makeutl;
...@@ -35,6 +33,8 @@ with Prj.Com; use Prj.Com; ...@@ -35,6 +33,8 @@ with Prj.Com; use Prj.Com;
with Sdefault; with Sdefault;
with Tempdir; with Tempdir;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Directory_Operations; use GNAT.Directory_Operations; with GNAT.Directory_Operations; use GNAT.Directory_Operations;
package body Prj.Env is package body Prj.Env is
......
...@@ -487,22 +487,40 @@ begin ...@@ -487,22 +487,40 @@ begin
pragma Import (C, save_argv); pragma Import (C, save_argv);
-- Saved value of argv (argument pointers), imported from misc.c -- Saved value of argv (argument pointers), imported from misc.c
function Len_Arg (Arg : Pos) return Nat;
-- Determine length of argument number Arg on original gnat1 command
-- line.
-------------
-- Len_Arg --
-------------
function Len_Arg (Arg : Pos) return Nat is
begin
for J in 1 .. Nat'Last loop
if save_argv (Arg).all (Natural (J)) = ASCII.NUL then
return J - 1;
end if;
end loop;
raise Program_Error;
end Len_Arg;
begin begin
-- Loop through arguments looking for -gnateT, also look for -gnatd.b -- Loop through arguments looking for -gnateT, also look for -gnatd.b
for Arg in 1 .. save_argc - 1 loop for Arg in 1 .. save_argc - 1 loop
declare declare
Argv_Ptr : constant Big_String_Ptr := save_argv (Arg); Argv_Ptr : constant Big_String_Ptr := save_argv (Arg);
Argv_Len : constant Nat := Len_Arg (Arg);
begin begin
if Argv_Len = 7
-- ??? Is there no problem accessing at indices 1 to 7 or 8 and then Argv_Ptr (1 .. 7) = "-gnateT"
-- without first checking if the length of the underlying string then
-- may be smaller? See back_end.adb for an example where function
-- Len_Arg is used to retrieve this length.
if Argv_Ptr (1 .. 7) = "-gnateT" then
Opt.Target_Dependent_Info_Read := True; Opt.Target_Dependent_Info_Read := True;
elsif Argv_Ptr (1 .. 8) = "-gnatd.b" then elsif Argv_Len >= 8
and then Argv_Ptr (1 .. 8) = "-gnatd.b"
then
Debug_Flag_Dot_B := True; Debug_Flag_Dot_B := True;
end if; end if;
end; end;
......
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