<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">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>