Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!peer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: glen herrmannsfeldt Newsgroups: comp.compilers Subject: Re: How to type braces for computed gotos Date: Sat, 19 Jul 2014 02:21:28 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 31 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-07-035@comp.compilers> References: <14-05-013@comp.compilers> <14-07-033@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: miucha.iecc.com 1405741786 50028 2001:470:1f07:1126:0:676f:7373:6970 (19 Jul 2014 03:49:46 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sat, 19 Jul 2014 03:49:46 +0000 (UTC) Keywords: PL/I, history, comment Posted-Date: 18 Jul 2014 23:49:46 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com X-Received-Bytes: 2112 X-Received-Body-CRC: 2865866913 Xref: csiph.com comp.compilers:1325 federation2005@netzero.com wrote: (snip) > There is one feature the compiler tests for that I assume the language also > has in it that I haven't seen much of before: the computed goto. What's I > don't quite understand how the branches are being typed. A computed goto > inside a void routine has the branches typed (void *), with the individual > items accessed in effect as references to (void *). (snip) > [That's an extension. In standard C, you can only goto a label. -John > Perhaps it's similar to this GCC extension > https://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html#Labels-as-Values] In standard C you can only goto label constants. In PL/I you can goto label constants or variables. In standard C, you should be able to make an array of jmp_buf and then longjmp() to an element of the array. However, you can only longjmp() to an element once. I don't know that I ever tried, but I believe you can GOTO a PL/I label variable more than once, as long as it still makes logical sense to do it. (That is, it isn't inside a procedure that has already returned.) -- glen [Ugh. -John]