Patchwork RFA: v3 PATCH to add on_quick_exit/quick_exit to std

login
register
mail settings
Submitter Paolo Carlini
Date Feb. 14, 2013, 5:46 p.m.
Message ID <511D22DA.8040706@oracle.com>
Download mbox | patch
Permalink /patch/220475/
State New
Headers show

Comments

Paolo Carlini - Feb. 14, 2013, 5:46 p.m.
Hi Rainer,

On 02/14/2013 04:45 PM, Rainer Orth wrote:
> Jason Merrill <jason@redhat.com> writes:
>
>> While I was going over the C++11 status page, I noticed that quick_exit is
>> implemented by glibc, it just needed to be added to the libstdc++ cstdlib
>> header.
> The test fails on Solaris 9:
>
> FAIL: 18_support/quick_exit/quick_exit.cc (test for excess errors)
> Excess errors:
> /vol/gcc/src/hg/trunk/local/libstdc++-v3/testsuite/18_support/quick_exit/quick_e
> xit.cc:28:3: error: '_Exit' is not a member of 'std'
>
> WARNING: 18_support/quick_exit/quick_exit.cc compilation failed to produce execu
> table
> extra_tool_flags are:
>   -std=gnu++11
>
> _Exit seems to be a C99 addition, only present since Solaris 10.
Indeed. Given the very simple nature of the testcase, I think something 
like the below can do, at least for 4.8.0, if Jason has no objections. 
Can you double check it on Solaris and in case commit it?

Thanks,
Paolo.

/////////////////////

Patch

Index: testsuite/18_support/quick_exit/quick_exit.cc
===================================================================
--- testsuite/18_support/quick_exit/quick_exit.cc	(revision 196056)
+++ testsuite/18_support/quick_exit/quick_exit.cc	(working copy)
@@ -25,7 +25,9 @@ 
 
 void handler()
 {
+#if _GLIBCXX_USE_C99
   std::_Exit(0);
+#endif
 }
 
 void wrong_handler()