Re: How to type braces for computed gotos

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Sat, 19 Jul 2014 02:21:28 +0000 (UTC)

          From comp.compilers

Related articles
Best "simple" C Compiler I've ever seen andrewchamberss@gmail.com (2014-05-04)
How to type braces for computed gotos (was: Best "simple" C Compiler I federation2005@netzero.com (2014-07-18)
Re: How to type braces for computed gotos gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-07-19)
Re: How to type braces for computed gotos ivan@ootbcomp.com (Ivan Godard) (2014-07-18)
Re: How to type braces for computed gotos gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-07-21)
Re: How to type braces for computed gotos federation2005@netzero.com (2014-07-21)
Re: How to type braces for computed gotos wclodius@earthlink.net (2014-07-21)
Re: How to type braces for computed gotos gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-07-23)
Re: How to type braces for computed gotos wclodius@earthlink.net (2014-07-22)
[1 later articles]
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Sat, 19 Jul 2014 02:21:28 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: 14-05-013 14-07-033
Keywords: PL/I, history, comment
Posted-Date: 18 Jul 2014 23:49:46 EDT

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]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.