Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #1325

Re: How to type braces for computed gotos

From glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups comp.compilers
Subject Re: How to type braces for computed gotos
Date 2014-07-19 02:21 +0000
Organization Aioe.org NNTP Server
Message-ID <14-07-035@comp.compilers> (permalink)
References <14-05-013@comp.compilers> <14-07-033@comp.compilers>

Show all headers | View raw


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]

Back to comp.compilers | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Best "simple" C Compiler I've ever seen andrewchamberss@gmail.com - 2014-05-04 18:23 -0700
  Re: Best "simple" C Compiler I've ever seen federation2005@netzero.com - 2014-06-30 12:42 -0700
  How to type braces for computed gotos (was: Best "simple" C Compiler I've ever seen) federation2005@netzero.com - 2014-07-18 14:44 -0700
    Re: How to type braces for computed gotos glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-07-19 02:21 +0000
      Re: How to type braces for computed gotos Ivan Godard <ivan@ootbcomp.com> - 2014-07-18 21:59 -0700
      Re: How to type braces for computed gotos federation2005@netzero.com - 2014-07-21 10:32 -0700
    Re: How to type braces for computed gotos (was: Best "simple" C Compiler I've ever seen) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-21 11:45 +0000
      Re: How to type braces for computed gotos glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-07-21 16:19 +0000
      Re: How to type braces for computed gotos wclodius@earthlink.net (William Clodius) - 2014-07-21 21:44 -0600
        Re: How to type braces for computed gotos glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-07-23 00:35 +0000
          Re: How to type braces for computed gotos wclodius@earthlink.net (William Clodius) - 2014-07-22 22:36 -0600
            Re: How to type braces for computed gotos anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-07-25 22:38 -0400

csiph-web