delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/25/06:20:03

Sender: crough45 AT amc DOT de
Message-Id: <97Apr25.120149gmt+0100.16645@internet01.amc.de>
Date: Fri, 25 Apr 1997 11:05:50 +0100
From: Chris Croughton <crough45 AT amc DOT de>
Mime-Version: 1.0
To: brennan AT mack DOT rt66 DOT com
Cc: djgpp AT delorie DOT com
Subject: Re: How is switch implemented?

Brennan "The Rev. Bas" Underwood wrote:

>GCC's extended C does! Just do
>switch (c) {
>  case 0 ... 12:
>
>  case 47 ... 88:
>}
>
>Note the space between the range endpoints and the ellipses.

But it's non-portable.  GCC extensions are not in the the 
ANSI or ISO standards, and no other compiler can be expected
to support them.  Some of us have to deal with other compilers
(there's no GCC for the Mac, for instance, and I'm informed
that people using several other machines don't use it because 
the code generation leads to large executables).

Chris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019