4 ms·
This is C. There's nothing questionable about this "style." It is just how C is written. How else are you going to free resources without a code section to do i
by UnoriginalGuy 9y ago
This is C. There's nothing questionable about this "style." It is just how C is written. How else are you going to free resources without a code section to do it? Copy/paste it dozens of times?
The specific code isn't "goto fail" anyway, it is more akin to a finally block.
- erdeszt 9y agoI was referring to the lack of curly braces around the body of the then clause. This code has nothing to do with resource management and gotos per se so I don't see where your frustration and attack comes from.
- avar 9y agoIf you compile your code with -Werror -Wmisleading-indentation it's no more dangerous than writing Python.
- gpvos 9y agoI think erdeszt is just referring to the lack of curly braces around the statements governed by the if statements. This can be done around any single-line statement block, and is generally safer in the face of merges from version control.