<div dir="ltr">The Plan9 C extensions are described here: <a href="http://doc.cat-v.org/plan_9/4th_edition/papers/compiler">http://doc.cat-v.org/plan_9/4th_edition/papers/compiler</a><div><br></div><div>... in which we find "The most important and most heavily used of the extensions is the declaration of an unnamed substructure or subunion." (Though it is worth observing that our extension here is less powerful than the Plan9 C extension in a couple of ways.)</div><div><br></div><div>I think using -fplan9-extensions for "the set of Plan9 C extensions that we support" seems appropriate, even if we don't support all of them, and if that flag means something different from what it means to GCC as a result. (And it's worth noting that we already support most of the other extensions as either GNU extensions or as part of C99.)</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, 30 Jul 2018 at 14:07, Friedman, Eli via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="m_8539025611218935696moz-cite-prefix">Adding a separate flag to control this
is probably fine. Not sure about the name fplan9-extensions; in
gcc, I think that includes some other extensions we don't
implement.<br>
<br>
-Eli<br>
<br>
On 7/30/2018 12:52 PM, Richard Smith wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Would it make sense to add a -fplan9-extensions
flag, to enable support for this without enabling all the other
MS extensions that we support?</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Mon, 30 Jul 2018 at 11:53, Friedman, Eli via
cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 7/30/2018
9:08 AM, Frank Redeker via cfe-dev wrote:<br>
> Hello List,<br>
><br>
> Given the following piece of code.<br>
><br>
> typedef union {<br>
> struct {<br>
> unsigned char LOW;<br>
> unsigned char HIGH;<br>
> };<br>
> unsigned short SHORT; <br>
> } UNION;<br>
><br>
> typedef struct {<br>
> UNION; // <-- use of type only<br>
> union {<br>
> unsigned char FOO;<br>
> };<br>
> } STRUCT;<br>
><br>
> STRUCT Variable;<br>
><br>
> void Function () {<br>
> Variable.LOW = 1;<br>
> }<br>
><br>
><br>
> This code compiles without any error using gcc 7.2 (When
compiling with<br>
> -ansi -pedantic I get the warning "ISO C90 doesn't
support unnamed<br>
> structs/unions". If I add -std=c11 the warning
disappears)<br>
<br>
Declaring an anonymous union like that non-standard; you need
to pass <br>
-fms-extensions.<br>
<br>
-Eli<br>
<br>
-- <br>
Employee of Qualcomm Innovation Center, Inc.<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora
Forum, a Linux Foundation Collaborative Project<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote>
</div>
</blockquote>
<p><br>
</p>
<pre class="m_8539025611218935696moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>