News for hackers. Stuff that matters.
Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” by ilek on Friday February 26, 2016 @12:03PM (#11182465)
I don't find something like the below frustrating really

if (a)

    ...
else

    ...
But for some reason I find the below _very_ frustrating. It feels misleading and I find it to be very, very ugly.

if (a)

    ...
else {

    /* Multi line block */

}
Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” by Cyph0n on Friday February 26, 2016 @12:27PM (#11182634)
Why is that an issue? You would use something like that extensively in Go or JS for example, where you need to perform a check on the returned (Go) or passed (JS callback) error value.

The else is executed if there is no error, in my style at least, so naturally it will contain more logic.

Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” by ilek on Friday February 26, 2016 @12:31PM (#11182666)
I just have a problem with the mixing of braces on an if/else chain I guess. I don't know how to explain it clearly, it just rubs me the wrong way?
Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” by delecti on Friday February 26, 2016 @12:24PM (#11182611)
I've actually never seen anyone do either of those.

I've seen

if (a) thing;

but never with an else, and certainly never with an else that has a multi-line block. That's definitely somethign I'd call out in a CR.

Re:GCC 6: -Wmisleading-indentation vs. “goto fail;” by ilek on Friday February 26, 2016 @12:33PM (#11182678)
I call it out in CRs when I see it and I've been fixing any of these I come across in code at work.

I'd rather a compiler forces me to put braces around everything than let people have the opportunity to do something like the latter from my original comment.