case bodies share one scope #51

Closed
opened 2026-10-08 18:43:11 +02:00 by alex-eg · 0 comments
Owner

A case body isn't braced, so (var bits u64 ...) in one case and
(var bits u32 ...) in the next is a C redefinition. Clang also warns
"label followed by a declaration is a C23 extension". Wrapping each
body in (do ...) works around it; the writer could do that itself.


Found with sexc dfafe8b while building vs-map-viewer (from its Sex-field-notes.org).

A `case` body isn't braced, so `(var bits u64 ...)` in one case and `(var bits u32 ...)` in the next is a C redefinition. Clang also warns "label followed by a declaration is a C23 extension". Wrapping each body in `(do ...)` works around it; the writer could do that itself. --- Found with sexc `dfafe8b` while building vs-map-viewer (from its `Sex-field-notes.org`).
alex-eg added the bug label 2026-10-08 18:43:11 +02:00
Sign in to join this conversation.