« Return to Thread: Mark throw_exception as noreturn?

Re: Mark throw_exception as noreturn?

by Mathias Gaunard-2 :: Rate this Message:

Reply to Author | View in Thread

Andrey Semashev wrote:

> I was wondering why the throw_exception function is not marked as
> noreturn? 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).

Why is throw_exception detected as returning something in the first place?

I've personally tried to force __attribute__((noreturn)) with GCC, but
it doesn't work, it says the function does return.

Looking at the code though, I can't tell what is wrong with it.
A fix to that would be appreciated. Without that, I'd personally rather
not use throw_exception.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

 « Return to Thread: Mark throw_exception as noreturn?