From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23500 invoked by alias); 8 Apr 2012 16:05:28 -0000 Received: (qmail 23489 invoked by uid 22791); 8 Apr 2012 16:05:26 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Apr 2012 16:05:12 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q38G5BuF011612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 8 Apr 2012 12:05:11 -0400 Received: from redhat.com (vpn-10-64.rdu.redhat.com [10.11.10.64]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q38G57ct002263 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 8 Apr 2012 12:05:10 -0400 Date: Sun, 08 Apr 2012 16:05:00 -0000 From: Marek Polacek To: Rick Hodgin Cc: gcc Subject: Re: Switch statement case range Message-ID: <20120408160507.GC2739@redhat.com> References: <1333900786.14645.YahooMailClassic@web125406.mail.ne1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1333900786.14645.YahooMailClassic@web125406.mail.ne1.yahoo.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00240.txt.bz2 On Sun, Apr 08, 2012 at 08:59:46AM -0700, Rick Hodgin wrote: > What are the possibilities of adding a GCC extension to allow: > > switch (foo) { > case 1: > case 2: > case 3 to 8: > case 9: > default: > } This already exists (and is a GNU extension): switch (foo) { case 1: break; case 3 ... 8: break; default: break; } Marek