home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / compiler / 1271 < prev    next >
Encoding:
Text File  |  1992-07-29  |  1.6 KB  |  43 lines

  1. Newsgroups: comp.compilers
  2. Path: sparky!uunet!gatech!news.byu.edu!eff!world!iecc!compilers-sender
  3. From: jfc@athena.mit.edu (John F Carr)
  4. Subject: Re: Pros and cons of high-level intermediate languages
  5. Reply-To: jfc@athena.mit.edu (John F Carr)
  6. Organization: Massachusetts Institute of Technology
  7. Date: Sat, 25 Jul 1992 15:06:25 GMT
  8. Approved: compilers@iecc.cambridge.ma.us
  9. Message-ID: <92-07-092@comp.compilers>
  10. References: <92-07-068@comp.compilers> <92-07-084@comp.compilers>
  11. Keywords: C, translator
  12. Sender: compilers-sender@iecc.cambridge.ma.us
  13. Lines: 28
  14.  
  15.     graham@maths.su.oz.au (Graham Matthews) writes:
  16.  
  17. >I think you will find that gcc 2.X allows you to have arrays of labels.
  18. >Any gcc experts out there to confirm this?
  19.  
  20. In gcc you can take the address of a label:
  21.  
  22.     foo:
  23.     ...
  24.     void *labelp = &&foo;
  25.  
  26. There is a design flaw in this language extension: labels are represented
  27. as (void *) rather than having a distinct type.  Until very recently, the
  28. FSF only cared about traditional 32 bit single address space processors*.
  29. On such machines, when label pointers are implemented as pointers to an
  30. instruction, label pointers are the same size as data pointers.
  31.  
  32.  
  33. * From the GNU coding standards document: "You can assume that all
  34. pointers have the same format, regardless of the type they point to, and
  35. that this is really an integer.  There are some weird machines where this
  36. isn't true, but they aren't important; don't waste time catering to them."
  37.  
  38. --
  39.     John Carr (jfc@athena.mit.edu)
  40. -- 
  41. Send compilers articles to compilers@iecc.cambridge.ma.us or
  42. {ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.
  43.