| delorie.com/archives/browse.cgi | search |
| Message-ID: | <3E05BC7B.4040605@earthlink.net> |
| From: | Martin Ambuhl <mambuhl AT earthlink DOT net> |
| User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 |
| X-Accept-Language: | en-us, en, de, fr, ru, el, zh |
| MIME-Version: | 1.0 |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: dynamic gotos possible with djgpp? |
| References: | <au1u53$vdj$1 AT news DOT online DOT de> |
| Lines: | 27 |
| Date: | Sun, 22 Dec 2002 13:22:09 GMT |
| NNTP-Posting-Host: | 67.210.12.252 |
| X-Complaints-To: | abuse AT earthlink DOT net |
| X-Trace: | newsread2.prod.itd.earthlink.net 1040563329 67.210.12.252 (Sun, 22 Dec 2002 05:22:09 PST) |
| NNTP-Posting-Date: | Sun, 22 Dec 2002 05:22:09 PST |
| Organization: | EarthLink Inc. -- http://www.EarthLink.net |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Lars O. Hansen wrote:
> void *x; /* or long *x as addresses are just integers (but may conflict with C type checking) */
> x=label1; /* label1 a label like a label for static gotos */
> goto x;
> possible?
Check your documentation. In the nodes "Local Labels" and "Labels
as Values" in gcc. info(under "C Extensions") you will find the
discussion.Check this code :
#include <stdio.h>
int main(void)
{
void *x = &&label1;
goto *x;
label0:puts("We hit label0, somehow");
return 0;
label1:puts("We got to label1, just where we were going!");
return 0;
label2:puts("We hit label2, somehow");
return 0;
}
[output]
We got to label1, just where we were going!
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |