This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: exceptions with longjmp (perhaps i am too stupid)
- From: Andrew Haley <aph at redhat dot com>
- To: Georg Steffers <georg at steffers dot org>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 13 Apr 2005 13:21:21 +0100
- Subject: Re: exceptions with longjmp (perhaps i am too stupid)
- References: <1113394049l.8809l.0l@onkels>
- Reply-to: gcc-help at gcc dot gnu dot org
Georg Steffers writes:
> Hi,
>
> i am working on a lib that should implement OO methods in C. I tried to
> build up an exception system using longjmp and ran into a problem. I am
> searching for an answer a month now and am actually not bit farther
> than at the beginning. Actually i am not sure if it is an issue with
> gcc or i did not understand correctly how longjmp should work. Perhaps
> anyone here can help.
>
> The problem is that if i make two longjmp, the second returning to the
> function that issued the first, than my stack seems to be corrupted (or
> something similar) I made a more or less simple example that did not
> use any other part of my the OO lib nor did any dynamic memory stuff,
> just a few functions that demonstates the problem.
See ISO C, Section 7.13.2,1 Para 2 on Page 244, particularly footnote
210.
Redirected to gcc-help.
Andrew.