public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Zack Weinberg" <zack@codesourcery.com>
To: Michael Matz <matz@suse.de>
Cc: Andrew MacLeod <amacleod@redhat.com>,
	 Daniel Jacobowitz <drow@mvista.com>,
	gcc mailing list <gcc@gcc.gnu.org>
Subject: Re: switch question in recog.c
Date: Tue, 07 Oct 2003 22:34:00 -0000	[thread overview]
Message-ID: <87d6d84r5m.fsf@codesourcery.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0310080010220.20328-100000@wotan.suse.de> (Michael Matz's message of "Wed, 8 Oct 2003 00:27:23 +0200 (CEST)")

Michael Matz <matz@suse.de> writes:

> Hi,
>
> On 7 Oct 2003, Andrew MacLeod wrote:
>
>> Huh. I would have failed that question miserably after using the
>> language for 20 years.
>
> Then you never used a variant of the holy, mighty device from Tom Duff ;-)
>
> Constructed useless example (i.e. not the usual memcpy() unrolling):

"For maximum obfuscation, the outer braces can be removed":

 extern void abort ();
 int f(int i)
 {
   switch (i & 1)
     while (1)
       if (i > 32) {
         abort ();
         case 0: return 1;
       } else {
         abort ();
         case 1: return 2;
       }
 }

> "case x" is a normal label (with the exception that it's scoped to
> the enclosing case statement) introducing a labeled statement, hence
> it can be placed everywhere as long as it's inside a switch.

Except you can't goto a case label.  Occasionally I want to be able to
write "goto default;".

zw

  parent reply	other threads:[~2003-10-07 22:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-07 18:54 Andrew MacLeod
2003-10-07 18:59 ` Daniel Jacobowitz
2003-10-07 19:16   ` Andrew MacLeod
2003-10-07 19:32     ` Joe Buck
2003-10-07 22:27     ` Michael Matz
2003-10-07 22:33       ` DJ Delorie
2003-10-07 22:38         ` Michael Matz
2003-10-07 22:46           ` Erik Trulsson
2003-10-07 23:03             ` Michael Matz
2003-10-07 22:34       ` Zack Weinberg [this message]
2003-10-13  2:15         ` Nix
2003-10-07 19:09 ` Dale Johannesen
2003-10-07 21:08   ` Richard Henderson
2003-10-07 19:31 Chris Lattner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d6d84r5m.fsf@codesourcery.com \
    --to=zack@codesourcery.com \
    --cc=amacleod@redhat.com \
    --cc=drow@mvista.com \
    --cc=gcc@gcc.gnu.org \
    --cc=matz@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).