transform_match: null statement after label for C17 portability#94
Merged
Conversation
`skip_target_node_join:` was immediately followed by a declaration (`char deferred_tgt_label_cond[512]`). A label may not precede a declaration in C17 and earlier, so Apple clang on the macos-14 release runner rejected it (`error: expected expression`) and the v0.6.0 release build failed (publish steps skipped — nothing was published). gcc and newer clang accept it as an extension, so PR CI and local builds passed. Add a null statement after the label. Verified: all backend .c files pass `clang -std=c17 -fsyntax-only`; extension builds; unaffected at runtime.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The v0.6.0 release build failed on the
macos-14runner with:skip_target_node_join:is a label immediately followed by a declaration (char deferred_tgt_label_cond[512]). In C17 and earlier a label may only precede a statement, not a declaration. Apple clang on macos-14 (default ~C17) rejects it; gcc and newer clang (C23 default) accept it as an extension — which is why PR CI (full-build-unix macos-latest) and local builds passed but the release runner did not.No partial release occurred: the build failure skipped
build-wheels,publish-python,publish-rust, andcreate-release— nothing was published to PyPI, crates.io, or GitHub releases.Fix
Add a null statement (
;) after the label. Verified:clang -std=c17 -fsyntax-onlypasses on all backend.cfiles (scanned every goto label; this was the only label-before-declaration).Why not switch the release runner to macos-latest?
That would mask non-conformant C that other strict toolchains would also reject, and swap a pinned runner for a moving target in arch-specific release artifacts. Fixing the code is the portable fix.
After merge: re-tag v0.6.0 to re-run the release.