Commit ecb955bc by Arnaud Charlet

[multiple changes]

2009-07-28  Sergey Rybin  <rybin@adacore.com>

	* gnat_ugn.texi: gnatcheck Deeply_Nested_Inlining rule: Update doc.

2009-07-28  Pascal Obry  <obry@adacore.com>

	* g-expect.adb: Record standard handles only on Windows.

From-SVN: r150145
parent 549fd9e4
2009-07-28 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi: gnatcheck Deeply_Nested_Inlining rule: Update doc.
2009-07-28 Pascal Obry <obry@adacore.com>
* g-expect.adb: Record standard handles only on Windows.
2009-07-27 Emmanuel Briot <briot@adacore.com> 2009-07-27 Emmanuel Briot <briot@adacore.com>
* prj.ads, prj-nmsc.adb (Override_Kind): add debug trace * prj.ads, prj-nmsc.adb (Override_Kind): add debug trace
......
...@@ -1195,21 +1195,25 @@ package body GNAT.Expect is ...@@ -1195,21 +1195,25 @@ package body GNAT.Expect is
pragma Warnings (Off, Pipe2); pragma Warnings (Off, Pipe2);
pragma Warnings (Off, Pipe3); pragma Warnings (Off, Pipe3);
On_Windows : constant Boolean := Directory_Separator = '\';
Input : File_Descriptor; Input : File_Descriptor;
Output : File_Descriptor; Output : File_Descriptor;
Error : File_Descriptor; Error : File_Descriptor;
begin begin
-- Since Windows does not have a separate fork/exec, we need to if On_Windows then
-- perform the following actions: -- Since Windows does not have a separate fork/exec, we need to
-- - save stdin, stdout, stderr -- perform the following actions:
-- - replace them by our pipes -- - save stdin, stdout, stderr
-- - create the child with process handle inheritance -- - replace them by our pipes
-- - revert to the previous stdin, stdout and stderr. -- - create the child with process handle inheritance
-- - revert to the previous stdin, stdout and stderr.
Input := Dup (GNAT.OS_Lib.Standin);
Output := Dup (GNAT.OS_Lib.Standout); Input := Dup (GNAT.OS_Lib.Standin);
Error := Dup (GNAT.OS_Lib.Standerr); Output := Dup (GNAT.OS_Lib.Standout);
Error := Dup (GNAT.OS_Lib.Standerr);
end if;
-- Since we are still called from the parent process, there is no way -- Since we are still called from the parent process, there is no way
-- currently we can cleanly close the unneeded ends of the pipes, but -- currently we can cleanly close the unneeded ends of the pipes, but
...@@ -1223,8 +1227,8 @@ package body GNAT.Expect is ...@@ -1223,8 +1227,8 @@ package body GNAT.Expect is
Portable_Execvp (Pid.Pid'Access, Cmd & ASCII.NUL, Args); Portable_Execvp (Pid.Pid'Access, Cmd & ASCII.NUL, Args);
-- The following commands are not executed on Unix systems, and are -- The following commands are not executed on Unix systems, and are only
-- only required for Windows systems. We are now in the parent process. -- required for Windows systems. We are now in the parent process.
-- Restore the old descriptors -- Restore the old descriptors
...@@ -1277,8 +1281,8 @@ package body GNAT.Expect is ...@@ -1277,8 +1281,8 @@ package body GNAT.Expect is
-- Reuse the standard output pipe for standard error -- Reuse the standard output pipe for standard error
Pipe3.all := Pipe2.all; Pipe3.all := Pipe2.all;
else
else
-- Create a separate pipe for standard error -- Create a separate pipe for standard error
if Create_Pipe (Pipe3) /= 0 then if Create_Pipe (Pipe3) /= 0 then
......
...@@ -21308,23 +21308,12 @@ for a generic declaration. ...@@ -21308,23 +21308,12 @@ for a generic declaration.
@cindex @code{Deeply_Nested_Inlining} rule (for @command{gnatcheck}) @cindex @code{Deeply_Nested_Inlining} rule (for @command{gnatcheck})
@noindent @noindent
Flags the body of a subprogram (or generic subprogram) if Flags a subprogram (or generic subprogram) if
pragma Inline has been applied to the subprogram but the body pragma Inline has been applied to the subprogram but the subprogram
contains a call to another inlined subprogram that results in nested inlining calls to another inlined subprogram that results in nested inlining
with nesting depth exceeding the value specified by the with nesting depth exceeding the value specified by the
@option{N} rule parameter. @option{N} rule parameter.
This rule assumes that pragma Inline applies equally to calls on
subprograms regardless of whether the subprogram declaration appears in the
same compilation unit as the call, or in a separately compiled
(e.g., @i{with}ed) unit.
This rule may be useful when either the @option{-gnatn} or @option{-gnatN}
option is used.
If a subprogram should be flagged according to this rule, the body declaration
is flagged only if it is not a completion of a subprogram declaration.
This rule requires the global analysis of all the compilation units that This rule requires the global analysis of all the compilation units that
are @command{gnatcheck} arguments; such analysis may affect the tool's are @command{gnatcheck} arguments; such analysis may affect the tool's
performance. performance.
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