<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: On initializing static variables</title>
	<atom:link href="http://boredzo.org/blog/archives/2007-01-04/on-initializing-static-variables/feed" rel="self" type="application/rss+xml" />
	<link>http://boredzo.org/blog/archives/2007-01-04/on-initializing-static-variables</link>
	<description>The personal weblog of Peter Hosey.</description>
	<lastBuildDate>Wed, 09 May 2012 18:26:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Vincent Gable</title>
		<link>http://boredzo.org/blog/archives/2007-01-04/on-initializing-static-variables/comment-page-1#comment-307356</link>
		<dc:creator>Vincent Gable</dc:creator>
		<pubDate>Tue, 23 Mar 2010 22:43:53 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-01-04/on-initializing-static-variables#comment-307356</guid>
		<description>If I&#039;m reading the last provision correctly, then you could get into trouble if the first member in a union was shorter than the longest, because only the first member of the union is guaranteed to be initialized to 0.


static union {
		uint8_t eight;
		uint64_t sixtyfour;
	} onlyEightBitsOfMeMustBeZero;



In practice, I&#039;d imagine the storage for a static variable is always filled with &lt;code&gt;0x00&lt;/code&gt; though.</description>
		<content:encoded><![CDATA[<p>If I&#8217;m reading the last provision correctly, then you could get into trouble if the first member in a union was shorter than the longest, because only the first member of the union is guaranteed to be initialized to 0.</p>
<p>static union {<br />
		uint8_t eight;<br />
		uint64_t sixtyfour;<br />
	} onlyEightBitsOfMeMustBeZero;</p>
<p>In practice, I&#8217;d imagine the storage for a static variable is always filled with <code>0x00</code> though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Stein</title>
		<link>http://boredzo.org/blog/archives/2007-01-04/on-initializing-static-variables/comment-page-1#comment-8707</link>
		<dc:creator>Patrick Stein</dc:creator>
		<pubDate>Mon, 19 Feb 2007 22:45:21 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-01-04/on-initializing-static-variables#comment-8707</guid>
		<description>That&#039;s what I thought was standard for years, but got bitten on Intel lately. At least this switch helps.</description>
		<content:encoded><![CDATA[<p>That&#8217;s what I thought was standard for years, but got bitten on Intel lately. At least this switch helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://boredzo.org/blog/archives/2007-01-04/on-initializing-static-variables/comment-page-1#comment-5059</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Thu, 04 Jan 2007 16:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://boredzo.org/blog/archives/2007-01-04/on-initializing-static-variables#comment-5059</guid>
		<description>It&#039;s worth pointing out that C99 compliance is &lt;em&gt;not&lt;/em&gt; on by default in new Xcode projects.

However, your test case seems to produce the same zero-ness even when I turn off the flag. Wouldn&#039;t count on it, though.

Daniel</description>
		<content:encoded><![CDATA[<p>It&#8217;s worth pointing out that C99 compliance is <em>not</em> on by default in new Xcode projects.</p>
<p>However, your test case seems to produce the same zero-ness even when I turn off the flag. Wouldn&#8217;t count on it, though.</p>
<p>Daniel</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.132 seconds -->

