kiwmi icon indicating copy to clipboard operation
kiwmi copied to clipboard

Fix build error from case labeled declaration

Open Uks2 opened this issue 2 years ago • 2 comments

This is maybe a gcc vs clang thing?

Uks2 avatar Jul 30 '22 21:07 Uks2

Seems like i’m too careless with these 😇

More to the point, this is usually ‘fixed’ by adding a semicolon immediately after the colon, like case whatevs:;.

ghost avatar Jul 30 '22 21:07 ghost

I usually wrap each of my cases in braces: case whatevs: { int i = 1; some_function( i ); break; } .... Has the advantange of making variable scopes a bit more intuitive, plus vim folds them nicely. But it seemed weird to do that only once in the entire code base.

Uks2 avatar Jul 30 '22 21:07 Uks2