<?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: Using volatile to achieve persistence!</title>
	<atom:link href="http://embeddedgurus.com/stack-overflow/2009/01/using-volatile-to-achieve-persistence/feed/" rel="self" type="application/rss+xml" />
	<link>http://embeddedgurus.com/stack-overflow/2009/01/using-volatile-to-achieve-persistence/</link>
	<description>Thoughts on embedded systems by Nigel Jones</description>
	<lastBuildDate>Thu, 09 Feb 2012 07:32:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Ashleigh</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/01/using-volatile-to-achieve-persistence/comment-page-1/#comment-1613</link>
		<dc:creator>Ashleigh</dc:creator>
		<pubDate>Wed, 18 Aug 2010 00:02:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/01/11/using-volatile-to-achieve-persistence/#comment-1613</guid>
		<description>Perhaps what all this means is that &quot;volatile&quot; is really the wrong name for the keyword.

It should perhaps be called &quot;do_exactly_like_code_shows_it_done_and_dont_get_clever&quot; but you can imagine that&#039;s a little long to type. [And even then its not really a good description of how volatile should work.]</description>
		<content:encoded><![CDATA[<p>Perhaps what all this means is that &#8220;volatile&#8221; is really the wrong name for the keyword.</p>
<p>It should perhaps be called &#8220;do_exactly_like_code_shows_it_done_and_dont_get_clever&#8221; but you can imagine that&#8217;s a little long to type. [And even then its not really a good description of how volatile should work.]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fahmi MEGDICHE</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/01/using-volatile-to-achieve-persistence/comment-page-1/#comment-92</link>
		<dc:creator>Fahmi MEGDICHE</dc:creator>
		<pubDate>Thu, 28 Jan 2010 14:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/01/11/using-volatile-to-achieve-persistence/#comment-92</guid>
		<description>I got the point, and to endorse it, gcc for Coldfire is generating two different code for the below listings:======== Listing 1 ========ptr_sram = &amp;SRAM_ADDRESS_BASE[TAB_MIFARE_CRYPTED_OFFSET];for (i = 0; i &lt; MAX_SECT_MIFARE/10; i++){    ptr_sram += (i * CRYPTED_DATA_LENGTH);} ======== Listing 2 ========for (i = 0; i &lt; MAX_SECT_MIFARE/10; i++){    ptr_sram = &amp;SRAM_ADDRESS_BASE[TAB_MIFARE_CRYPTED_OFFSET + (i * CRYPTED_DATA_LENGTH)];}Listing 2 works while Listing 1 is a disaster (w/ and w/o optimization). So I take the opportunity and recall you about whether gcc is a decent compiler</description>
		<content:encoded><![CDATA[<p>I got the point, and to endorse it, gcc for Coldfire is generating two different code for the below listings:======== Listing 1 ========ptr_sram = &amp;SRAM_ADDRESS_BASE[TAB_MIFARE_CRYPTED_OFFSET];for (i = 0; i &lt; MAX_SECT_MIFARE/10; i++){    ptr_sram += (i * CRYPTED_DATA_LENGTH);} ======== Listing 2 ========for (i = 0; i &lt; MAX_SECT_MIFARE/10; i++){    ptr_sram = &amp;SRAM_ADDRESS_BASE[TAB_MIFARE_CRYPTED_OFFSET + (i * CRYPTED_DATA_LENGTH)];}Listing 2 works while Listing 1 is a disaster (w/ and w/o optimization). So I take the opportunity and recall you about whether gcc is a decent compiler</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/01/using-volatile-to-achieve-persistence/comment-page-1/#comment-91</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Thu, 28 Jan 2010 13:37:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/01/11/using-volatile-to-achieve-persistence/#comment-91</guid>
		<description>Well compiler code generators are funny animals. In my experience you can sometimes make a fairly simply change to code - and have the compiler generate a substantially different set of op codes. Thus if you have something that currently works by relying upon the code generator working a certain way, then you have a maintenance nightmare. Far better to make your requirements explicitly known (by in this case using volatile) rather than relying upon turning off the optimizer and hoping that it works.</description>
		<content:encoded><![CDATA[<p>Well compiler code generators are funny animals. In my experience you can sometimes make a fairly simply change to code &#8211; and have the compiler generate a substantially different set of op codes. Thus if you have something that currently works by relying upon the code generator working a certain way, then you have a maintenance nightmare. Far better to make your requirements explicitly known (by in this case using volatile) rather than relying upon turning off the optimizer and hoping that it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fahmi MEGDICHE</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/01/using-volatile-to-achieve-persistence/comment-page-1/#comment-90</link>
		<dc:creator>Fahmi MEGDICHE</dc:creator>
		<pubDate>Thu, 28 Jan 2010 13:00:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/01/11/using-volatile-to-achieve-persistence/#comment-90</guid>
		<description>&quot;However as soon as you added or subtracted code, or updated your compiler you&#039;d run the risk of the code no longer working.&quot;What does this infer ?</description>
		<content:encoded><![CDATA[<p>&quot;However as soon as you added or subtracted code, or updated your compiler you&#39;d run the risk of the code no longer working.&quot;What does this infer ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/01/using-volatile-to-achieve-persistence/comment-page-1/#comment-89</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Thu, 28 Jan 2010 11:41:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/01/11/using-volatile-to-achieve-persistence/#comment-89</guid>
		<description>Turning off the optimizer in order to achieve some end is usually a very bad idea. Indeed I can think of only one case where I&#039;ve found this to be necessary (when one is generating the code access sequence necessary to disable watchdogs or perform similar guarded operations).Anyway, to answer your question. Would turning off the optimizer solve this problem - probably. However as soon as you added or subtracted code, or updated your compiler you&#039;d run the risk of the code no longer working.As to what other cases would require this. That&#039;s an interesting question to which I don&#039;t have the answer. I guess this is part of what makes embedded systems challenging!</description>
		<content:encoded><![CDATA[<p>Turning off the optimizer in order to achieve some end is usually a very bad idea. Indeed I can think of only one case where I&#39;ve found this to be necessary (when one is generating the code access sequence necessary to disable watchdogs or perform similar guarded operations).Anyway, to answer your question. Would turning off the optimizer solve this problem &#8211; probably. However as soon as you added or subtracted code, or updated your compiler you&#39;d run the risk of the code no longer working.As to what other cases would require this. That&#39;s an interesting question to which I don&#39;t have the answer. I guess this is part of what makes embedded systems challenging!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Engineer</title>
		<link>http://embeddedgurus.com/stack-overflow/2009/01/using-volatile-to-achieve-persistence/comment-page-1/#comment-88</link>
		<dc:creator>Engineer</dc:creator>
		<pubDate>Thu, 28 Jan 2010 08:38:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/01/11/using-volatile-to-achieve-persistence/#comment-88</guid>
		<description>Are you suggesting that even if we turn off optimization, we still need the volatile qualifier ? If so what other cases would demand that ?Fahmi MEGDICHE</description>
		<content:encoded><![CDATA[<p>Are you suggesting that even if we turn off optimization, we still need the volatile qualifier ? If so what other cases would demand that ?Fahmi MEGDICHE</p>
]]></content:encoded>
	</item>
</channel>
</rss>

