hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

8.9K
active users

Replace if(0) in printf with gotos?

(Poll is non binding, just for fun)

Cassandrich

Proposed patch to replace if(0) obfuscation with explicit gotos. 🤔

Looks sufficiently non-invasive and like a significant improvement to readability.

@dalias I never thought I would've said that, but please use gotos! :D

@dalias It's a misconception that `goto`s must not be used. There are usecases - especially in C which lacks the 'defer' statement - where it's just needed to write non-awful code.

@Gottox switch statements are gotos anyway. 🙃

@dalias neither is readable, why are you hardwiring out chunks of the code that are still there?

@landley I'm not. But the if(0) led folks to misread it the way you just did, which is why I'm trying to rectify that.