Newsgroups: | comp.compilers |
From: | jfc@athena.mit.edu (John F Carr) |
Organization: | Massachusetts Institute of Technology |
Date: | Sat, 25 Jul 1992 15:06:25 GMT |
References: | 92-07-068 92-07-084 |
Keywords: | C, translator |
graham@maths.su.oz.au (Graham Matthews) writes:
>I think you will find that gcc 2.X allows you to have arrays of labels.
>Any gcc experts out there to confirm this?
In gcc you can take the address of a label:
foo:
...
void *labelp = &&foo;
There is a design flaw in this language extension: labels are represented
as (void *) rather than having a distinct type. Until very recently, the
FSF only cared about traditional 32 bit single address space processors*.
On such machines, when label pointers are implemented as pointers to an
instruction, label pointers are the same size as data pointers.
* From the GNU coding standards document: "You can assume that all
pointers have the same format, regardless of the type they point to, and
that this is really an integer. There are some weird machines where this
isn't true, but they aren't important; don't waste time catering to them."
--
John Carr (jfc@athena.mit.edu)
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.