Re: like to know why it is segmentation fault on simple throw-exception program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jun 1, 3:46 pm, Victor Bazarov <v.baza...@xxxxxxxxxxxxxxx> wrote:
> On 6/1/2011 6:44 PM, Ian Collins wrote:
>
>
>
> > On 06/ 2/11 10:34 AM, Victor Bazarov wrote:
> >> On 6/1/2011 6:16 PM, Ian Collins wrote:
> >>> On 06/ 2/11 10:01 AM, eric wrote:
> >>>> Dear comp.lang.c++ reader or advced c++ programers:
> >>>>  [...]
> >>> Also using exception specifiers is generally regarded as bad practice.
>
> >> Really?
>
> >>> It will land you in all sorts of problems if something you call throws
> >>> some other exception type.
>
> >> That can be too deep for the OP. The inquiry looked very much like a
> >> homework (done by the OP, which is commendable), part of a C++ course,
> >> in which they *might* learn later that an exception specification is
> >> frowned upon by some c.l.c++ inhabitants.
>
> > There are some who don't frown upon them?
>
> <shrug> I don't see them in production code (except the 'throw' with the
> empty parens, which promises that nothing is thrown, as I understand
> it), so I don't care one way or the other.
>
> V
> --
> I do not respond to top-posted replies, please don't ask

---------------------------------------------------------------
Dear Victor or advanced c++ program(especially on g++ camp):
  I follow many of your suggestion, ie change && to || in push
then
after it run
-------------
terminate called after throwing an instance of 'char const*'
Aborted
----------this is better than Segmentation fault, but still not
expected-------

the trouble is happen at call of throw and catch (receiveing) part
it show somehting before throw, but it did not reponse any (or first)
statement in catch block
plz help,(its on gnu/gcc/g++ of linux), thanks a lot in advance, Eric



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux