<div dir="ltr">On Thu, Sep 12, 2013 at 12:58 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So declarations are a bit more hairy. It seems that GCC allows static<br>
initalization of flexible array members as an extension:<br>
<a href="http://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html" target="_blank">http://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html</a></blockquote><div><br></div><div>We don't support that extension. :) And if we did, we could just not warn on declarations using that extension.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Also, the C standard itself shows a declaration of a value type using<br>
a flexible array member (granted, it is to show what could be<br>
undefined behavior):<br>
<br>
6.7.2.1p19 (ISO/IEC 9899:2011):<br>
<br>
struct s { int n; double d[]; };<br>
struct s t1 = { 0 }; // valid<br>
struct s t2 = { 1, { 4.2 }}; // invalid<br>
t1.n = 4; // valid<br>
t1.d[0] = 4.2; // might be undefined behavior<br></blockquote><div> </div><div>I don't think this indicates anything.</div><div><br></div><div>-Eli </div></div></div></div>