<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 10, 2012, at 16:12 , Gedare Bloom wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">These are called "designated initializers" c.f.<span class="Apple-converted-space"> </span><a href="http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html">http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html</a><br><br>They don't work for headers that are included from C++ code; i.e. C++ does not compile them properly. That is one concern I know about. But for a plain C file they should be OK to use.<br></span></blockquote></div><div><br></div>That is my concern also, people start to see that and begin putting them in headers.  They are in the Freescale headers for the MPC55XX, and caused me some pain in the past.<div><br></div><div>The only use in a header I can think of is to define const initializers that have a unique name that are in global scope.  I suppose that can be replaced with:</div><div><br></div><div>extern const struct structure_tag initializer_for_stated_purpose;</div><div><br></div><div>and then initializer_for_stated_purpose can be placed in its own "C" file, though you now have to look in that C file to double check that it is really set up as its name describes it, and I suppose that short-circuits optimization also.</div><div><br></div><div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px; ">Peter<br>-----------------<br>Peter Dufault<br>HD Associates, Inc.      Software and System Engineering</span></font></div></span></span>
</div>
<br></div></body></html>