Fix idiocy in previous patch
Dave Korn
dave.korn@artimi.com
Tue Jun 28 17:16:00 GMT 2005
----Original Message----
>From: Alexandre Oliva
>Sent: 27 June 2005 19:30
> On Jun 8, 2005, Nick Clifton <nickc@redhat.com> wrote:
>> switch (foo)
>> {
>> case 0: prefix="hi";
>> case 1: prefix="bye";
>> case 2: prefix="ciao";
>> strcpy (buffer, "%s Nick", prefix);
>> break;
>> }
>
> You can do that in C. Just make the cases the `then' part of if(0)s:
>
> switch (foo)
> {
> case 0: prefix="hi";
> if (0) { case 1: prefix="bye"; }
> if (0) { case 2: prefix="ciao"; }
> strcpy (buffer, "%s Nick", prefix);
> break;
> }
>
> then hope nobody ever has to look at this piece of code again :-)
Yow! I've wanted a trick like that soooo many times down the years! Did
you read that somewhere, or do we have to name it "Oliva's device"?
> Yuck :-)
It's sick, but I like it!
cheers,
DaveK
--
Can't think of a witty .sigline today....
More information about the Binutils
mailing list