Re: "__throw_logic_error" abort, but print no error message out

2008-11-14 Thread Jonathan Wakely
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


"__throw_logic_error" abort, but print no error message out

2008-11-12 Thread Bernd Roesch
Hello

the file in bits/basic_string.tcc call it.

template
template 
  _CharT*
  basic_string<_CharT, _Traits, _Alloc>::
  _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, 
  forward_iterator_tag)
  {
#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
if (__beg == __end && __a == _Alloc())
  return _S_empty_rep()._M_refdata();
#endif  // NB: Not required, but considered best practice.
if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
  __throw_logic_error(__N("basic_string::_S_construct NULL not valid"));
  <---



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 ? 

When i add testcode  

std::__throw_logic_error("error text\n");

then also NO text is print out but program is quit

I have a gcc4.3.2 68k amigaos build, maybe problem is here, but i dont
understand how this can work with the current source and what i must change
in the build, without change in gcc core Files.

Please help

bye Bernd



"__throw_logic_error" abort, but print no error message out

2008-11-12 Thread Bernd Roesch
Hello

the file in bits/basic_string.tcc call it.

template
template 
  _CharT*
  basic_string<_CharT, _Traits, _Alloc>::
  _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, 
  forward_iterator_tag)
  {
#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
if (__beg == __end && __a == _Alloc())
  return _S_empty_rep()._M_refdata();
#endif  // NB: Not required, but considered best practice.
if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
  __throw_logic_error(__N("basic_string::_S_construct NULL not valid"));
  <---



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 ? 

When i add testcode  

std::__throw_logic_error("error text\n");

then also NO text is print out but program is quit

I have a gcc4.3.2 68k amigaos build, maybe problem is here, but i dont
understand how this can work with the current source and what i must change
in the build, without change in gcc core Files.

Please help

bye Bernd



"__throw_logic_error" abort, but print no error message out

2008-11-10 Thread Bernd Roesch
Hello

the file in bits/basic_string.tcc call it.

template
template 
  _CharT*
  basic_string<_CharT, _Traits, _Alloc>::
  _S_construct(_InIterator __beg, _InIterator __end, const _Alloc& __a, 
  forward_iterator_tag)
  {
#ifndef _GLIBCXX_FULLY_DYNAMIC_STRING
if (__beg == __end && __a == _Alloc())
  return _S_empty_rep()._M_refdata();
#endif  // NB: Not required, but considered best practice.
if (__builtin_expect(__is_null_pointer(__beg) && __beg != __end, 0))
  __throw_logic_error(__N("basic_string::_S_construct NULL not valid"));



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 ? 

When i add testcode  

std::__throw_logic_error("error text\n");

then also text is print out but program is quit

I have a gcc4.3.2 68k amigaos build, maybe problem is here, but i dont
understand how this can work with the current source and what i must change
in the build, without change in gcc core Files.

Please help

bye Bernd