Boost logo

Boost :

From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-05-01 15:10:40


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 01 May 2008 14:23 pm, Sebastian Redl wrote:
> Hi,
>
> My quest for a general exception_ptr for GCC has reached its end, in the
> sense of, "I can't make it any better without modifying GCC."

Which begs the question, are you going to modify GCC? "Copying and rethrowing
exceptions" is on their todo list for their c++0x support:

http://gcc.gnu.org/projects/cxx0x.html

By the way, your implementation segfaults for me at the end of the program
when using a global exception_ptr, test program attached.

- --
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIGhW55vihyNWuA4URAjaPAJ957TZHT7T7FVsRYV44PlOqKjuUTgCg3hUo
RzE4wYUelWL/e5UxE8munxw=
=uTJS
-----END PGP SIGNATURE-----

--Boundary-00=_5WhGIJ48Qo4buB1
Content-Type: text/x-c++src;
  charset="utf-8";
  name="redl_ep_segfault.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
        filename="redl_ep_segfault.cpp"

// A proof-of-concept implementation and test of exception_ptr for
// gcc. Requires internal unwind-cxx.h header from gcc source code.
// Tested with gcc 4.1.2 and gcc 3.4.6.

// Copyright (c) 2008 Frank Mori Hess <fmhess_at_[hidden]>

// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <iostream>
#include "exception_ptr_gcc.hpp"
#include <stdexcept>
#include <string>
#include <boost/weak_ptr.hpp>

boost::exception_ptr global_ep;

int main()
{
        try
        {
                throw std::runtime_error("my error");
        }
        catch(...)
        {
                global_ep = boost::current_exception();
        }
        return 0;
}

--Boundary-00=_5WhGIJ48Qo4buB1--


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk