<?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: A nail for a fuse</title>
	<atom:link href="http://embeddedgurus.com/state-space/2009/11/a-nail-for-a-fuse/feed/" rel="self" type="application/rss+xml" />
	<link>http://embeddedgurus.com/state-space/2009/11/a-nail-for-a-fuse/</link>
	<description>A Blog by Miro Samek</description>
	<lastBuildDate>Tue, 08 May 2012 09:20:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Miro Samek</title>
		<link>http://embeddedgurus.com/state-space/2009/11/a-nail-for-a-fuse/comment-page-1/#comment-35</link>
		<dc:creator>Miro Samek</dc:creator>
		<pubDate>Sat, 30 Jan 2010 01:58:19 +0000</pubDate>
		<guid isPermaLink="false">http://embeddedgurus.com/state-space/2009/11/27/a-nail-for-a-fuse/#comment-35</guid>
		<description>In embedded systems you typically need to define your own assertion macro, as the standard &lt;assert.h&gt; is not applicable (no stderr to write to and no OS to exit to either). As you define your own assetion macro, you typically end up calling a function to handle the assertion violation (see for example my DDJ article &lt;a href=&quot;http://www.ddj.com/cpp/184401686&quot; rel=&quot;nofollow&quot;&gt;&quot;An Exception or a Bug?&quot;&lt;/a&gt;). This callback function is perhaps a better place to differentiate the behavior in the production code vs. debug version:void onAssert__(char const *file, int line) {#ifdef NDEBUG /* release version? */    . . .#else         /* debug version */    . . .        #endif}</description>
		<content:encoded><![CDATA[<p>In embedded systems you typically need to define your own assertion macro, as the standard &lt;assert.h&gt; is not applicable (no stderr to write to and no OS to exit to either). As you define your own assetion macro, you typically end up calling a function to handle the assertion violation (see for example my DDJ article <a href="http://www.ddj.com/cpp/184401686" rel="nofollow">&quot;An Exception or a Bug?&quot;</a>). This callback function is perhaps a better place to differentiate the behavior in the production code vs. debug version:void onAssert__(char const *file, int line) {#ifdef NDEBUG /* release version? */    . . .#else         /* debug version */    . . .        #endif}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fileoffset</title>
		<link>http://embeddedgurus.com/state-space/2009/11/a-nail-for-a-fuse/comment-page-1/#comment-33</link>
		<dc:creator>fileoffset</dc:creator>
		<pubDate>Sat, 30 Jan 2010 01:36:34 +0000</pubDate>
		<guid isPermaLink="false">http://embeddedgurus.com/state-space/2009/11/27/a-nail-for-a-fuse/#comment-33</guid>
		<description>One way to leave assertions in but not produce unexpected results in production, is to define a macro or set of macro&#039;s that you would use instead of the classic assert(). You can then modify the behavior of the assert macro&#039;s so they function differently for production and debug code. For example:#ifdef DEBUG#define ASSERT(a) assert(a)#elsif RELEASE#define ASSERT(a) lcd.displayError(a)#endif</description>
		<content:encoded><![CDATA[<p>One way to leave assertions in but not produce unexpected results in production, is to define a macro or set of macro&#39;s that you would use instead of the classic assert(). You can then modify the behavior of the assert macro&#39;s so they function differently for production and debug code. For example:#ifdef DEBUG#define ASSERT(a) assert(a)#elsif RELEASE#define ASSERT(a) lcd.displayError(a)#endif</p>
]]></content:encoded>
	</item>
</channel>
</rss>

