<?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: Efficient C Tips #3 &#8211; Avoiding post increment / decrement</title>
	<atom:link href="http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/feed/" rel="self" type="application/rss+xml" />
	<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/</link>
	<description>Thoughts on embedded systems by Nigel Jones</description>
	<lastBuildDate>Fri, 10 Feb 2012 14:37:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Raul</title>
		<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/comment-page-1/#comment-13483</link>
		<dc:creator>Raul</dc:creator>
		<pubDate>Wed, 25 Jan 2012 13:59:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2008/08/01/efficient-c-tips-3-avoiding-post-increment-decrement/#comment-13483</guid>
		<description>Thank you!</description>
		<content:encoded><![CDATA[<p>Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/comment-page-1/#comment-13462</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Wed, 25 Jan 2012 00:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2008/08/01/efficient-c-tips-3-avoiding-post-increment-decrement/#comment-13462</guid>
		<description>IAR seems to have removed the original article. I have replaced the link with another one that gives a better explanation (also from IAR :-))</description>
		<content:encoded><![CDATA[<p>IAR seems to have removed the original article. I have replaced the link with another one that gives a better explanation (also from IAR <img src='http://embeddedgurus.com/stack-overflow/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Raul</title>
		<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/comment-page-1/#comment-13449</link>
		<dc:creator>Raul</dc:creator>
		<pubDate>Tue, 24 Jan 2012 16:56:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2008/08/01/efficient-c-tips-3-avoiding-post-increment-decrement/#comment-13449</guid>
		<description>Hi,

Thank you for your great articles!

The link to IAR website is broken. Can you fix it please? Thanks again.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thank you for your great articles!</p>
<p>The link to IAR website is broken. Can you fix it please? Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lundin</title>
		<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/comment-page-1/#comment-2818</link>
		<dc:creator>Lundin</dc:creator>
		<pubDate>Wed, 01 Dec 2010 07:46:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2008/08/01/efficient-c-tips-3-avoiding-post-increment-decrement/#comment-2818</guid>
		<description>I can&#039;t recall a CPU where this would actually matter for efficiency reasons. The real issue here is that *ptr++ may be hard to read. C&#039;s operator precedence rules are far from obvious, and that&#039;s the main reason you should avoid it. 

There&#039;s also the issue with order of evaluation: if you write *ptr++, then you might be tempted to write the classic C bug *ptr = *ptr++, which relies on the implementation-defined order of evaluation (and is banned by MISRA-C). For this reason, professional programmers never use the ++ operator together with other operators ever.</description>
		<content:encoded><![CDATA[<p>I can&#8217;t recall a CPU where this would actually matter for efficiency reasons. The real issue here is that *ptr++ may be hard to read. C&#8217;s operator precedence rules are far from obvious, and that&#8217;s the main reason you should avoid it. </p>
<p>There&#8217;s also the issue with order of evaluation: if you write *ptr++, then you might be tempted to write the classic C bug *ptr = *ptr++, which relies on the implementation-defined order of evaluation (and is banned by MISRA-C). For this reason, professional programmers never use the ++ operator together with other operators ever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Jones</title>
		<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/comment-page-1/#comment-2811</link>
		<dc:creator>Nigel Jones</dc:creator>
		<pubDate>Tue, 30 Nov 2010 16:42:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2008/08/01/efficient-c-tips-3-avoiding-post-increment-decrement/#comment-2811</guid>
		<description>Thanks for the information Mark - I was not aware of this.</description>
		<content:encoded><![CDATA[<p>Thanks for the information Mark &#8211; I was not aware of this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MarkM</title>
		<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/comment-page-1/#comment-2810</link>
		<dc:creator>MarkM</dc:creator>
		<pubDate>Tue, 30 Nov 2010 16:39:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2008/08/01/efficient-c-tips-3-avoiding-post-increment-decrement/#comment-2810</guid>
		<description>PowerPC specifically has instructions that support an addressing mode (the &quot;U&quot; instructions) where pre-increment/pre-decrement is provided for free in the load/store instruction itself.  There is no equivalent post-increment/post-decrement instruction.</description>
		<content:encoded><![CDATA[<p>PowerPC specifically has instructions that support an addressing mode (the &#8220;U&#8221; instructions) where pre-increment/pre-decrement is provided for free in the load/store instruction itself.  There is no equivalent post-increment/post-decrement instruction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Murray</title>
		<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/comment-page-1/#comment-52</link>
		<dc:creator>Murray</dc:creator>
		<pubDate>Wed, 27 Jan 2010 19:39:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2008/08/01/efficient-c-tips-3-avoiding-post-increment-decrement/#comment-52</guid>
		<description>On GCC with an ARM7tdmi it seems to make no difference at all. However, if you use &quot;uint32_t i;&quot; or &quot;register uint32_t i;&quot; for your local variable declaration, you see a significant size reduction and a speed increase.</description>
		<content:encoded><![CDATA[<p>On GCC with an ARM7tdmi it seems to make no difference at all. However, if you use &quot;uint32_t i;&quot; or &quot;register uint32_t i;&quot; for your local variable declaration, you see a significant size reduction and a speed increase.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Layton</title>
		<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/comment-page-1/#comment-51</link>
		<dc:creator>Mike Layton</dc:creator>
		<pubDate>Tue, 26 Jan 2010 09:39:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2008/08/01/efficient-c-tips-3-avoiding-post-increment-decrement/#comment-51</guid>
		<description>If you read K&amp;R (the original C) you find that they were motivated to make the language as terse as possible--as I recall, to allow transmission at eg. 300 baud.  I don&#039;t recall hearing a case where terse code is more optimal for space or speed (with or without optimization).  Most of the time I&#039;m adding code to insure optimization.</description>
		<content:encoded><![CDATA[<p>If you read K&amp;R (the original C) you find that they were motivated to make the language as terse as possible&#8211;as I recall, to allow transmission at eg. 300 baud.  I don&#39;t recall hearing a case where terse code is more optimal for space or speed (with or without optimization).  Most of the time I&#39;m adding code to insure optimization.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ashleigh</title>
		<link>http://embeddedgurus.com/stack-overflow/2008/08/efficient-c-tips-3-avoiding-post-increment-decrement/comment-page-1/#comment-50</link>
		<dc:creator>ashleigh</dc:creator>
		<pubDate>Tue, 26 Jan 2010 00:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2008/08/01/efficient-c-tips-3-avoiding-post-increment-decrement/#comment-50</guid>
		<description>I&#039;ve had many long arguments with C programmers who insist that *ptr++ WILL ALWAYS be better / faster / whatever. And I&#039;ve never come across a case yet where it unambiguously is so.Check the generated code!Avoiding these operators also makes the code much more readable.</description>
		<content:encoded><![CDATA[<p>I&#39;ve had many long arguments with C programmers who insist that *ptr++ WILL ALWAYS be better / faster / whatever. And I&#39;ve never come across a case yet where it unambiguously is so.Check the generated code!Avoiding these operators also makes the code much more readable.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

