Article View: comp.std.c
Article #3421Re: GOTO single exit point (was: Re: How to eliminate GOTO?)
From: halasz
Date: Fri, 15 Sep 1995 03:20
Date: Fri, 15 Sep 1995 03:20
32 lines
1145 bytes
1145 bytes
In article <437fk4$5no@eco.twg.com>, lance@eco.twg.com (Lance Kibblewhite) writes
> ....
> What do you mean 'C' doesn't have local functions!
>
> Give me a real language with local functions, and a decent optimizer
> anyday.
And, you know, there is no other means of combining re:entransie, "signal",
and "longjmp", until "signal" takes a pointer that it passes to the handler:
y()
{ jmp_buf b;
x(int k)
{ longjmp(b, k);
}
signal(SIGFPE, x);
if (!setjmp(b)) 1/0;
return 1;
}
(yes, I know that this is not enough, but I hope that you understand.)
or
x(int k, void *b)
{ longjmp((jmp_buf) b, k);
}
y()
{ jmp_buf b;
signal(SIGFPE, x, b);
if (!setjmp(b)) 1/0;
return 1;
}
Technical Details
Message-ID:
<43are7$rr@caip.rutgers.edu>Path:
arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mailReferences:
<3vn1ht$kj8@martha.utk.edu> <41cke4$gtd@sparcserver.lrz-muenchen.de> <437fk4$5no@eco.twg.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mail From: halasz@caip.rutgers.edu Newsgroups: comp.std.c,comp.lang.c Subject: Re: GOTO single exit point (was: Re: How to eliminate GOTO?) Date: 14 Sep 1995 23:20:39 -0400 Organization: Rutgers University Message-ID: <43are7$rr@caip.rutgers.edu> References: <3vn1ht$kj8@martha.utk.edu> <41cke4$gtd@sparcserver.lrz-muenchen.de> <437fk4$5no@eco.twg.com> NNTP-Posting-Host: caip.rutgers.edu