This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Switch statement case range


On Sun, Apr 8, 2012 at 10:59 AM, Rick Hodgin <foxmuldrster@yahoo.com> 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:
> }
>
> in C/C++ case statements?

GCC used to have a range extension for case:

   case 3..8

which has been removed.  Back to the future?

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]