Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7877215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:18:15+00:00 2026-06-03T03:18:15+00:00

How do I get the anonymous struct/union behaviour activated by -fplan9-extensions in GCC to

  • 0

How do I get the anonymous struct/union behaviour activated by -fplan9-extensions in GCC to work in Clang?

I’m getting errors assigning to members of anonymous when using designated initializers, and I’m not getting the free casting to the type of an anonymous member. Both these work under GCC with the aforementioned extension activated.

typedef struct {int hi;} Embedded;
typedef struct {Embedded;} Encapsulating;

Encapsulating poo = {.hi = 3;};
error: field designator 'hi' does not refer to any field in type 'Encapsulating'

void takes_embedded(Embedded *m);
takes_embedded(&poo);
warning: incompatible pointer types passing 'Encapsuating *' to parameter of type 'Embedded *'
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:18:16+00:00Added an answer on June 3, 2026 at 3:18 am

    Here’s how to get the -fplan9-extensions functionality in Clang:

    • Ensure that the functionality meets the seven criteria for Clang extensions.
    • Mail the cfe-dev mailing list and ask whether the Clang community would accept a patch implementing this extension.
    • Familiarize yourself with the LLVM coding standards.
    • Check out and build LLVM and clang from SVN.
    • Make a patch implementing the functionality and mail it to the cfe-commits mailing list.
    • Respond to comments on that mailing list. For a first patch to Clang, you should expect to need to revise it several times before it is accepted by the community. Be patient and persevere.
    • If all goes well, your patch will be checked into Clang.

    Some of the -fplan9-extensions functionality (the struct { Embedded; } part) is already available under the -fms-extensions argument, but designated initializers for such anonymous members are not supported. The other part is similar in spirit to GCC’s __attribute__((transparent_union)) functionality, which Clang already supports.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to have an anonymous union with const members? I have the
I get confused when I see examples of self invoked anonymous functions in Javascript
How can I get output from Java anonymous classes? In .Net I would use
Is there a way I can get this array walk with my anonymous function
I have a LINQ statement that returns an anonymous type. I need to get
I have a struct: typedef struct _n { int type; union { char *s;
union members may not have destructors or constructors. So I can't template the following
I cant get my WCF serve to windows authenticate If I allow anonymous everything
I've needed to get a value back from an anonymous inner class. Inner classes
I am using reflection to get the values out of an anonymous type: object

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.