Boost logo

Boost :

Subject: Re: [boost] Mark throw_exception as noreturn?
From: Gennaro Prota (gennaro.prota_at_[hidden])
Date: 2008-10-25 19:03:52


Andrey Semashev wrote:
> Hi,
>
> I was wondering why the throw_exception function is not marked as
> noreturn?

I don't know. That could be because not all compilers support
that annotation (but then, that's not usually something which
scares Boost off).

> This makes it troublesome to use it as a drop-in replacement
> for throw statements as it starts to flag compiler warnings about
> missing return statements in non-void functions.
>
> I suggest to mark the function as noreturn at least for compilers that
> support it. GCC has __attribute__((noreturn)), MSVC has
> __declspec(noreturn).

I don't know what they guys here want to do, or whether there's
an accepted solution to this. For the immediate needs, however,
you could use BOOST_UNREACHABLE_RETURN in the calling function.

-- 
Genny

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