News for hackers. Stuff that matters.
Re:Humans should think of sizeof() as a function, says Linus... by douche on Saturday May 30, 2015 @10:16AM (#9630221)
I'm not seeing what the issue here is, besides that this won't compile because of mismatched braces. There is no need to put braces around the contents of a case block. Unless I'm switching on an enum, I rarely find a compelling reason to use switch/case, and there's usually a cleaner way to do it.
Re:Humans should think of sizeof() as a function, says Linus... by dllthomas on Saturday May 30, 2015 @03:35PM (#9631489)
"There is no need to put braces around the contents of a case block."

There is here.

In some dialects, you can only declare a variable at the start of a block. From the perspective of the compiler, a "case block" isn't actually a block, just stuff between labels. In order to declare temporary_variable, it may be necessary to put the braces, and it is probably best practice as temporary_variable may otherwise be exposed to later cases (and in C++, a jump over a variable declaration seems to produce an error).