buffet / kiwmi

A fully programmable Wayland Compositor
Mozilla Public License 2.0
585 stars 22 forks source link

Fix build error from case labeled declaration #67

Open Uks2 opened 2 years ago

Uks2 commented 2 years ago

This is maybe a gcc vs clang thing?

ghost commented 2 years ago

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:;.

Uks2 commented 2 years ago

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.