public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Switch statement case range
@ 2012-04-08 16:00 Rick Hodgin
  2012-04-08 16:03 ` Gabriel Dos Reis
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Rick Hodgin @ 2012-04-08 16:00 UTC (permalink / raw)
  To: gcc

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?

Best regards,
Rick C. Hodgin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-08 16:00 Switch statement case range Rick Hodgin
@ 2012-04-08 16:03 ` Gabriel Dos Reis
  2012-04-08 16:05 ` Marek Polacek
  2012-04-08 16:07 ` Robert Dewar
  2 siblings, 0 replies; 11+ messages in thread
From: Gabriel Dos Reis @ 2012-04-08 16:03 UTC (permalink / raw)
  To: Rick Hodgin; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-08 16:00 Switch statement case range Rick Hodgin
  2012-04-08 16:03 ` Gabriel Dos Reis
@ 2012-04-08 16:05 ` Marek Polacek
  2012-04-08 16:07   ` Rick Hodgin
  2012-04-08 16:07 ` Robert Dewar
  2 siblings, 1 reply; 11+ messages in thread
From: Marek Polacek @ 2012-04-08 16:05 UTC (permalink / raw)
  To: Rick Hodgin; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-08 16:00 Switch statement case range Rick Hodgin
  2012-04-08 16:03 ` Gabriel Dos Reis
  2012-04-08 16:05 ` Marek Polacek
@ 2012-04-08 16:07 ` Robert Dewar
  2 siblings, 0 replies; 11+ messages in thread
From: Robert Dewar @ 2012-04-08 16:07 UTC (permalink / raw)
  To: Rick Hodgin; +Cc: gcc

On 4/8/2012 11:59 AM, 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:
> }
>
> in C/C++ case statements?
>
> Best regards,
> Rick C. Hodgin

I think there is very little enthusiasm these days for adding
non-standard extensions of this type.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-08 16:05 ` Marek Polacek
@ 2012-04-08 16:07   ` Rick Hodgin
  2012-04-08 16:15     ` Oleg Endo
  0 siblings, 1 reply; 11+ messages in thread
From: Rick Hodgin @ 2012-04-08 16:07 UTC (permalink / raw)
  To: Marek Polacek; +Cc: gcc

Thank you!

I'd like to find out some day exactly how much I _don't_ know. :-)

Best regards,
Rick C. Hodgin

--- On Sun, 4/8/12, Marek Polacek <polacek@redhat.com> wrote:

> From: Marek Polacek <polacek@redhat.com>
> Subject: Re: Switch statement case range
> To: "Rick Hodgin" <foxmuldrster@yahoo.com>
> Cc: "gcc" <gcc@gcc.gnu.org>
> Date: Sunday, April 8, 2012, 12:05 PM
> 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
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-08 16:07   ` Rick Hodgin
@ 2012-04-08 16:15     ` Oleg Endo
  2012-04-08 16:23       ` Rick Hodgin
  0 siblings, 1 reply; 11+ messages in thread
From: Oleg Endo @ 2012-04-08 16:15 UTC (permalink / raw)
  To: Rick Hodgin; +Cc: Marek Polacek, gcc

On Sun, 2012-04-08 at 09:07 -0700, Rick Hodgin wrote:
> Thank you!
> 
> I'd like to find out some day exactly how much I _don't_ know. :-)
> 

Knock yourself out ;)
http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html

Cheers,
Oleg

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-08 16:15     ` Oleg Endo
@ 2012-04-08 16:23       ` Rick Hodgin
  2012-04-12 23:26         ` Rick Hodgin
  0 siblings, 1 reply; 11+ messages in thread
From: Rick Hodgin @ 2012-04-08 16:23 UTC (permalink / raw)
  To: Oleg Endo; +Cc: Marek Polacek, gcc

As comprehensive as that list is (and it is indeed quite impressive), it is yet a small subset I assure you. LOL! :-)

I have to be honest ... the more I learn about GCC the more impressed I am.  I think it is, without a doubt, the best GNU project in history.

Has there ever been any talk of nominating Richard Stallman for the Nobel Peace Prize (seriously)?

Best regards,
Rick C. Hodgin

--- On Sun, 4/8/12, Oleg Endo <oleg.endo@t-online.de> wrote:

> From: Oleg Endo <oleg.endo@t-online.de>
> Subject: Re: Switch statement case range
> To: "Rick Hodgin" <foxmuldrster@yahoo.com>
> Cc: "Marek Polacek" <polacek@redhat.com>, "gcc" <gcc@gcc.gnu.org>
> Date: Sunday, April 8, 2012, 12:14 PM
> On Sun, 2012-04-08 at 09:07 -0700,
> Rick Hodgin wrote:
> > Thank you!
> > 
> > I'd like to find out some day exactly how much I
> _don't_ know. :-)
> > 
> 
> Knock yourself out ;)
> http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html
> 
> Cheers,
> Oleg
> 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-08 16:23       ` Rick Hodgin
@ 2012-04-12 23:26         ` Rick Hodgin
  2012-04-13  8:29           ` Jonathan Wakely
  0 siblings, 1 reply; 11+ messages in thread
From: Rick Hodgin @ 2012-04-12 23:26 UTC (permalink / raw)
  To: gcc

I was wondering if anyone had a response to this?  No one responded on- or off-list, which was both surprising and confusing.

Thanks! :-)

Best regards,
Rick C. Hodgin

--- On Sun, 4/8/12, Rick Hodgin <foxmuldrster@yahoo.com> wrote:

> From: Rick Hodgin <foxmuldrster@yahoo.com>
> 
> ...I think [GCC] is, without a doubt, the best GNU
> project in history.
> 
> Has there ever been any talk of nominating Richard Stallman
> for the Nobel Peace Prize (seriously)?
> 
> Best regards,
> Rick C. Hodgin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-12 23:26         ` Rick Hodgin
@ 2012-04-13  8:29           ` Jonathan Wakely
  2012-04-13 15:58             ` Rick Hodgin
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Wakely @ 2012-04-13  8:29 UTC (permalink / raw)
  To: Rick Hodgin; +Cc: gcc

On 13 April 2012 00:26, Rick Hodgin wrote:
> I was wondering if anyone had a response to this?  No one responded on- or off-list, which was both surprising and confusing.

Why? What sort of response were you expecting?

What has GCC or GNU got to do with "fraternity between nations, for
the abolition or reduction of standing armies and for the holding and
promotion of peace congresses"?

More to the point, RMS hasn't added code to GCC for many years, it's
been the work of lots and lots of others for years.  Where's my nobel
prize?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-13  8:29           ` Jonathan Wakely
@ 2012-04-13 15:58             ` Rick Hodgin
  2012-04-13 16:04               ` Jonathan Wakely
  0 siblings, 1 reply; 11+ messages in thread
From: Rick Hodgin @ 2012-04-13 15:58 UTC (permalink / raw)
  To: gcc

--- On Fri, 4/13/12, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> > I was wondering if anyone had a response to this?  No
> > one responded on- or off-list, which was both surprising
> > and confusing.
> Why? What sort of response were you expecting?

I didn't have a particular expectation (outside of just some kind of response). :-)

> What has GCC or GNU got to do with "fraternity between
> nations, for the abolition or reduction of standing armies
> and for the holding and promotion of peace congresses"?

Well, GCC is part of GNU.  GNU is of the Free Software Foundation.  The FSF was started by Stallman on principles which were contrary to seemingly fundamental mindsets of the time (and today).  His was an ideology organized into a specific thing thta grew into far more than I think even he envisioned.  The off-shoots of his creation are powering the world's economy today, powering virtually every machine ever built (at least as an option to do so).

Were it not for free software, our world would be markedly different in 2012.

Now, specifically to GCC, Linux is built on it.  Stallman initially wrote the compiler, debugger, etc., and in so doing got the ball rolling.  He's since moved on to the more philosophical end regarding software patents, intellectual property, and the need for free software on principles.  He's also devoted his life pretty much exclusively toward this end since 1983/4.

> More to the point, RMS hasn't added code to GCC for many years,
> it's been the work of lots and lots of others for years. 
> Where's my nobel prize?

Free Software exists as it does today because of Stallman.

And I wasn't suggesting RMS get the Nobel Prize for GCC, or even specifically for GNU, but rather for the ideology and philosophical contributions to the world the FSF has created.  His initial contributions to all of those (then) fledgling efforts which have panned out into a diverse machine encompassing millions of developers world-wide.

Is it not single greatest humanitarian effort begun by a person with an ideological philosophy?  His is of such a creation, offered up unto humanity in a way which is unlike other efforts, one where the free labor of literally millions of people across the globe, their skills, their talents, the best they have to offer in many cases, is literally handed over to everyone else for free.  And the philosophy behind the GPL ensures that those offerings cannot be retracted at a future date.

The Nobel Prize honors people who have changed the world in positive ways, contributing something which makes human life better.  RMS has done that with the FSF, GNU in general, and also its offerings (like GCC, surely the fundamental backbone of nearly all free software in existence).

I don't think it would be out of line at all to consider the ramifications RMS has had upon this world.  He has maintained his vision to free software (and not open source) all along, because he believes and pushes that the right to BE ABLE to share and to have the contributions of your neighbors (both near and far) added to prior work by yourself and others is paramount to having a great society.

What better type of improvement is ther than to take the work of millions and offer it for billions to use or improve upon (should they choose)?

Name another endeavor piloted by a single individual, especially one which has faced such staunch and continuous opposition at every point, which has then reached such a scope as to touch literally billions of lives, giving every one of them the chance to improve what they have today (should they choose to do so).

I'm simply not aware of any efforts of similar scope.

Best regards,
Rick C. Hodgin

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Switch statement case range
  2012-04-13 15:58             ` Rick Hodgin
@ 2012-04-13 16:04               ` Jonathan Wakely
  0 siblings, 0 replies; 11+ messages in thread
From: Jonathan Wakely @ 2012-04-13 16:04 UTC (permalink / raw)
  To: Rick Hodgin; +Cc: gcc

On 13 April 2012 16:58, Rick Hodgin <foxmuldrster@yahoo.com> wrote:
> --- On Fri, 4/13/12, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>> > I was wondering if anyone had a response to this?  No
>> > one responded on- or off-list, which was both surprising
>> > and confusing.
>> Why? What sort of response were you expecting?
>
> I didn't have a particular expectation (outside of just some kind of response). :-)

Well, you got one.  But much as I like the work of RMS and the FSF, if
you just wanted to chat this list isn't the right place for it, this
is for discussing development of GCC.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-04-13 16:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-08 16:00 Switch statement case range Rick Hodgin
2012-04-08 16:03 ` Gabriel Dos Reis
2012-04-08 16:05 ` Marek Polacek
2012-04-08 16:07   ` Rick Hodgin
2012-04-08 16:15     ` Oleg Endo
2012-04-08 16:23       ` Rick Hodgin
2012-04-12 23:26         ` Rick Hodgin
2012-04-13  8:29           ` Jonathan Wakely
2012-04-13 15:58             ` Rick Hodgin
2012-04-13 16:04               ` Jonathan Wakely
2012-04-08 16:07 ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).