From ecb955bcf28766d13b2391a8642cc5395a4c5572 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 28 Jul 2009 09:29:50 +0200 Subject: [PATCH] [multiple changes] 2009-07-28 Sergey Rybin * gnat_ugn.texi: gnatcheck Deeply_Nested_Inlining rule: Update doc. 2009-07-28 Pascal Obry * g-expect.adb: Record standard handles only on Windows. From-SVN: r150145 --- gcc/ada/ChangeLog | 8 ++++++++ gcc/ada/g-expect.adb | 30 +++++++++++++++++------------- gcc/ada/gnat_ugn.texi | 17 +++-------------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index bf78d8c..476e505 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,11 @@ +2009-07-28 Sergey Rybin + + * gnat_ugn.texi: gnatcheck Deeply_Nested_Inlining rule: Update doc. + +2009-07-28 Pascal Obry + + * g-expect.adb: Record standard handles only on Windows. + 2009-07-27 Emmanuel Briot * prj.ads, prj-nmsc.adb (Override_Kind): add debug trace diff --git a/gcc/ada/g-expect.adb b/gcc/ada/g-expect.adb index 405b033..5f88f63 100644 --- a/gcc/ada/g-expect.adb +++ b/gcc/ada/g-expect.adb @@ -1195,21 +1195,25 @@ package body GNAT.Expect is pragma Warnings (Off, Pipe2); pragma Warnings (Off, Pipe3); + On_Windows : constant Boolean := Directory_Separator = '\'; + Input : File_Descriptor; Output : File_Descriptor; Error : File_Descriptor; begin - -- Since Windows does not have a separate fork/exec, we need to - -- perform the following actions: - -- - save stdin, stdout, stderr - -- - replace them by our pipes - -- - 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); - Error := Dup (GNAT.OS_Lib.Standerr); + if On_Windows then + -- Since Windows does not have a separate fork/exec, we need to + -- perform the following actions: + -- - save stdin, stdout, stderr + -- - replace them by our pipes + -- - 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); + Error := Dup (GNAT.OS_Lib.Standerr); + end if; -- 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 @@ -1223,8 +1227,8 @@ package body GNAT.Expect is Portable_Execvp (Pid.Pid'Access, Cmd & ASCII.NUL, Args); - -- The following commands are not executed on Unix systems, and are - -- only required for Windows systems. We are now in the parent process. + -- The following commands are not executed on Unix systems, and are only + -- required for Windows systems. We are now in the parent process. -- Restore the old descriptors @@ -1277,8 +1281,8 @@ package body GNAT.Expect is -- Reuse the standard output pipe for standard error Pipe3.all := Pipe2.all; - else + else -- Create a separate pipe for standard error if Create_Pipe (Pipe3) /= 0 then diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 865f5da..b776c90 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -21308,23 +21308,12 @@ for a generic declaration. @cindex @code{Deeply_Nested_Inlining} rule (for @command{gnatcheck}) @noindent -Flags the body of a subprogram (or generic subprogram) if -pragma Inline has been applied to the subprogram but the body -contains a call to another inlined subprogram that results in nested inlining +Flags a subprogram (or generic subprogram) if +pragma Inline has been applied to the subprogram but the subprogram +calls to another inlined subprogram that results in nested inlining with nesting depth exceeding the value specified by the @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 are @command{gnatcheck} arguments; such analysis may affect the tool's performance. -- 2.7.4