Skip to content

Support anonymous struct embedding via -fms-extensions#9022

Open
chaosape wants to merge 1 commit into
diffblue:developfrom
chaosape:plan9-extensions
Open

Support anonymous struct embedding via -fms-extensions#9022
chaosape wants to merge 1 commit into
diffblue:developfrom
chaosape:plan9-extensions

Conversation

@chaosape
Copy link
Copy Markdown

When -fms-extensions is passed, tagged struct/union members without a declarator name are treated as anonymous embedding (Plan 9 C extension). This allows code using the GCC extension where 'struct tag;' inside another struct inlines the tagged struct's fields.

The implementation lets the tagged anonymous member fall through to the existing anonymous member handling (the $anon naming + set_anonymous pass), rather than skipping it with 'continue'.

Only this one behavior is implemented — no other MSVC or Plan 9 extensions. The internal config field is named
allow_anonymous_struct_embedding to be explicit about scope.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

When -fms-extensions is passed, tagged struct/union members without a
declarator name are treated as anonymous embedding (Plan 9 C extension).
This allows code using the GCC extension where 'struct tag;' inside
another struct inlines the tagged struct's fields.

The implementation lets the tagged anonymous member fall through to the
existing anonymous member handling (the $anon naming + set_anonymous
pass), rather than skipping it with 'continue'.

Only this one behavior is implemented — no other MSVC or Plan 9
extensions. The internal config field is named
allow_anonymous_struct_embedding to be explicit about scope.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.59%. Comparing base (808dae2) to head (c0a1b97).
⚠️ Report is 25 commits behind head on develop.

Files with missing lines Patch % Lines
src/goto-cc/gcc_mode.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9022      +/-   ##
===========================================
+ Coverage    80.55%   80.59%   +0.04%     
===========================================
  Files         1707     1711       +4     
  Lines       189051   189458     +407     
  Branches        73       73              
===========================================
+ Hits        152299   152703     +404     
- Misses       36752    36755       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant