home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16765 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  1.1 KB

  1. Xref: sparky comp.lang.c++:16765 comp.std.c++:1609
  2. Newsgroups: comp.lang.c++,comp.std.c++
  3. Path: sparky!uunet!usc!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watmath!plg.uwaterloo.ca!gjditchf
  4. From: gjditchf@plg.uwaterloo.ca (Glen Ditchfield)
  5. Subject: Re: Proposal - enhancement for switch statement.
  6. Message-ID: <By6BF7.5K5@math.uwaterloo.ca>
  7. Sender: news@math.uwaterloo.ca (News Owner)
  8. Organization: University of Waterloo
  9. References: <1992Nov19.163944.19935@ucc.su.OZ.AU> <1992Nov20.195059.1@vax1.bham.ac.uk> <9232811.8739@mulga.cs.mu.OZ.AU>
  10. Date: Mon, 23 Nov 1992 14:40:18 GMT
  11. Lines: 15
  12.  
  13. In article <9232811.8739@mulga.cs.mu.OZ.AU> fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
  14. >Perhaps a good way to indicate that the fallthrough is deliberate would be to
  15. >use an explicit goto.
  16. >    switch(x) { ...
  17. >        case 2:    ...
  18. >            goto case_3:    /* fall through */
  19. >        case_3:            /* [Note the "_"!] */
  20. >        case 3:    ...
  21. >    }
  22. >
  23. >Any half-decent compiler will of course be able to optimize out the goto.
  24. >It is still irritating that you are not allowed to jump to case labels,
  25.  
  26. If I remember correctly, the Plan 9 C compiler does allow "goto case 3"
  27. (that is, with no underscore).
  28.