This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: "__throw_logic_error" abort, but print no error message out
- From: "Jonathan Wakely" <jwakely dot gcc at gmail dot com>
- To: "Bernd Roesch" <nospamname at web dot de>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 14 Nov 2008 16:42:19 +0000
- Subject: Re: "__throw_logic_error" abort, but print no error message out
- References: <yam11273.2118.294602192@mail.gmx.net>
2008/11/12 Bernd Roesch:
>
> But in libstdc++v3/src/functexcept.cc
>
> void
> __throw_logic_error(const char*)
> { std::abort(); }
>
> this call abort and there is no string print out, because abort get no
> Parameter as far i see.
>
> How can this work ?
It works by calling abort(), as intended.
If you take another look in functexcept.cc you'll see that when
__EXCEPTIONS is defined the following definition is used:
void
__throw_logic_error(const char* __s)
{ throw logic_error(_(__s)); }
This allows the library to call __throw_logic_error without caring
whether the target supports exceptions, or whether they have been
disabled with -fno-exceptions. If exceptions are enabled
__throw_logic_error will throw std::logic_error, otherwise it will
call abort().
It seems that the 68k amigaos port does not support exceptions, or
your GCC was configured without support for exceptions.
Hope that helps,
Jonathan