logoalt Hacker News

"possibly the nastiest piece of abuse of the C switch statement rules I know of"

18 points • by pavel_lishin • today at 1:44 PM • 4 comments • view on HN

Comments

pavel_lishin • today at 3:37 PM

I did a double-take when I saw the name of the author, as I've been playing his puzzle packs for years. (Not to mention Putty - which I haven't used in probably a decade, but was my go-to in Windows.)

janderland • today at 3:13 PM

Haha, love this. It’s funny they’re saying “don’t use GOTO” because this approach makes it obvious that switch cases are equivalent to GOTO which can transport you into one of the impossible of statements.

TZubiri • today at 2:18 PM

> exposed a compiler bug

i’m 99% sure this was unnecessary and hubrish

whats that phrase about if you write the most clever code you can within the writing context, future you without that context won’t be able to understand it.

well you were so clever that the compiler didnt understand it