cgen: fix bit-field generation for option/result types in minified st…#26670
Merged
Conversation
…ructs (fixes vlang#26622) Option and result types are represented as structs in C, which cannot be used as bit-fields. Skip the bit-field optimization for these types in minified structs to avoid C compilation errors. Co-authored-by: iFlow CLI <iflow> (glm-5)
MSVC handles bit-fields differently than GCC/Clang, causing the minify_option_field test to fail on Windows MSVC CI. - Add _not_msvc_windows.vv suffix pattern to skip logic - Rename test files to use the new suffix This follows the existing naming convention for platform/compiler- specific test handling (similar to _nix.vv, _msvc_windows.vv).
Delta456
approved these changes
Mar 1, 2026
cestef
pushed a commit
to cestef/v
that referenced
this pull request
Mar 9, 2026
vlang#26670) * cgen: fix bit-field generation for option/result types in minified structs (fixes vlang#26622) Option and result types are represented as structs in C, which cannot be used as bit-fields. Skip the bit-field optimization for these types in minified structs to avoid C compilation errors. Co-authored-by: iFlow CLI <iflow> (glm-5) * tests: skip minify_option_field test on MSVC MSVC handles bit-fields differently than GCC/Clang, causing the minify_option_field test to fail on Windows MSVC CI. - Add _not_msvc_windows.vv suffix pattern to skip logic - Rename test files to use the new suffix This follows the existing naming convention for platform/compiler- specific test handling (similar to _nix.vv, _msvc_windows.vv).
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.
…ructs (fixes #26622)
Option type is represented as structs in C, which cannot be used as bit-fields. Skip the bit-field optimization for this type in minified structs to avoid C compilation errors.
✦ Fix MSVC test failure for
minify_option_fieldtestMSVC handles bit-fields differently than GCC/Clang, causing the
minify_option_fieldtest to fail on Windows MSVC CI.Changes:
_not_msvc_windows.vvsuffix pattern to skip logic incoutput_test.vminify_option_field.vv→minify_option_field_not_msvc_windows.vv✦ This follows the existing naming convention (similar to
_nix.vv,_msvc_windows.vv,_gcc_windows.vv) forplatform/compiler-specific test handling.
Co-authored-by: iFlow CLI (glm-5)