Empirical Study On How C Devs Use Goto In Practice Says "Not Harmful"
Edsger Dijkstra famously opined in 1968 on the danger of Goto statements. New submitter Mei Nagappan writes with a mellower view, nearly 50 years later: By qualitatively and quantitatively analyzing a statistically valid random sample from almost 2 million C files and 11K+ projects, we find that developers limit themselves to using goto appropriately in most cases, and not in an unrestricted manner like Dijkstra feared, thus suggesting that goto does not appear to be harmful in practice.
(Here's the preprint linked from above abstract.)
It gives me so much more flexibility and power. The computed comfrom is even better.
Obligatory: http://xkcd.com/292/
I bet the "valid random sample" didn't include any projects from the Obfuscated C Code Contest.
Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
Some sort of nested do { ... } while(false); and break; would be my first suggestion.
Rgds
Damon
http://m.earth.org.uk/
is far more entertaining than a mere goto.
"To those who are overly cautious, everything is impossible. "