<?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/">
	<channel>
		<title><![CDATA[MISRA Discussion Forums - 6.19 Preprocessing Directives]]></title>
		<link>https://forum.misra.org.uk/</link>
		<description><![CDATA[MISRA Discussion Forums - https://forum.misra.org.uk]]></description>
		<pubDate>Thu, 05 Nov 2026 15:13:31 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Does #define CAL_TP const volatile violate Rule 19.4]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1342</link>
			<pubDate>Thu, 27 Apr 2017 12:47:42 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=2851">steveudog</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1342</guid>
			<description><![CDATA[Is it permissible to have more than one attribute in the define?<br />
<br />
My code is auto-generated using Simulink.  It contains the define:<br />
#define CAL_TP const volatile<br />
<br />
Our MISRA checker determined this to be a violation of Rule 19.4, but some of my colleagues dispute this.<br />
They think it is a flaw in the checker.<br />
Is this a violation?]]></description>
			<content:encoded><![CDATA[Is it permissible to have more than one attribute in the define?<br />
<br />
My code is auto-generated using Simulink.  It contains the define:<br />
#define CAL_TP const volatile<br />
<br />
Our MISRA checker determined this to be a violation of Rule 19.4, but some of my colleagues dispute this.<br />
They think it is a flaw in the checker.<br />
Is this a violation?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 19.4 Does "#define XY -1" violate 19.4]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1232</link>
			<pubDate>Thu, 17 Mar 2016 15:37:29 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=2961">fst@bm</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1232</guid>
			<description><![CDATA[Dear MISRA Team,<br />
<br />
as I found out, 2 out of 3 commercial MISRA checking tools report the statement "#define XY -1" to be a violation of rule 19.4. I am not sure whether or not this #define actually violates rule 19.4 but if so I would not fully understand the risk associated with this particular #define statement. Could someone please help and discuss if this is a violation and why it should be avoided?<br />
<br />
Thank your for your support!]]></description>
			<content:encoded><![CDATA[Dear MISRA Team,<br />
<br />
as I found out, 2 out of 3 commercial MISRA checking tools report the statement "#define XY -1" to be a violation of rule 19.4. I am not sure whether or not this #define actually violates rule 19.4 but if so I would not fully understand the risk associated with this particular #define statement. Could someone please help and discuss if this is a violation and why it should be avoided?<br />
<br />
Thank your for your support!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[is File Include Guard applicable/reviewed with Rule 19.4 ?]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1082</link>
			<pubDate>Fri, 18 Jul 2014 18:17:14 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=3438">edgartorres0523</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1082</guid>
			<description><![CDATA[Hi team, <br />
First of all, I want to thank you for supporting people with this amazing forum that is very useful , "Thumbs up".<br />
<br />
I have the following File Include Guard:<br />
#ifndef _MYHEADER_H_ // beginning<br />
#define _MYHEADER_H_ <br />
...<br />
#endif // end<br />
<br />
My question is if File Include Guards have to be applicable/reviewed with the MISRA-C:2004 Rule 19.4 ?<br />
<br />
Thanks and Best Regards.<br />
edgartorres0523]]></description>
			<content:encoded><![CDATA[Hi team, <br />
First of all, I want to thank you for supporting people with this amazing forum that is very useful , "Thumbs up".<br />
<br />
I have the following File Include Guard:<br />
#ifndef _MYHEADER_H_ // beginning<br />
#define _MYHEADER_H_ <br />
...<br />
#endif // end<br />
<br />
My question is if File Include Guards have to be applicable/reviewed with the MISRA-C:2004 Rule 19.4 ?<br />
<br />
Thanks and Best Regards.<br />
edgartorres0523]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[macro contains unaceptable items misra c 2004 19.4]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=973</link>
			<pubDate>Wed, 31 Jul 2013 11:35:32 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=2804">manojkdi</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=973</guid>
			<description><![CDATA[Example <br />
<br />
#define MACRO_2 1(this macro is defined in some other file)<br />
<br />
#define MACRO_1 MACRO_2<br />
<br />
this statement is causing the warning in "macro contains unacceptable items misra c 2004 19.4".Is this warning valid? Is it really a invalid macro definition?]]></description>
			<content:encoded><![CDATA[Example <br />
<br />
#define MACRO_2 1(this macro is defined in some other file)<br />
<br />
#define MACRO_1 MACRO_2<br />
<br />
this statement is causing the warning in "macro contains unacceptable items misra c 2004 19.4".Is this warning valid? Is it really a invalid macro definition?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 19.4 do-while(0) for single statements]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=963</link>
			<pubDate>Tue, 28 May 2013 06:24:02 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=2695">wwinzer</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=963</guid>
			<description><![CDATA[While I fully understand the need to weld multiple statements in a function-like macro into a compound statement using the do-while(0) construct, I wonder why rule 19.4 explicitely includes macros with only one statement. <br />
<blockquote class="mycode_quote"><cite>Quote:</cite> The do-while-zero construct is used to wrap a series of <span style="font-weight: bold;" class="mycode_b">one</span> or more statements and ensure correct behaviour.</blockquote>
<br />
I've searched the net high and low and could not find any reason for requiring single statements to be encapsulated in do-while(0). Could you give an example here of code that breaks when disregarding this rule?]]></description>
			<content:encoded><![CDATA[While I fully understand the need to weld multiple statements in a function-like macro into a compound statement using the do-while(0) construct, I wonder why rule 19.4 explicitely includes macros with only one statement. <br />
<blockquote class="mycode_quote"><cite>Quote:</cite> The do-while-zero construct is used to wrap a series of <span style="font-weight: bold;" class="mycode_b">one</span> or more statements and ensure correct behaviour.</blockquote>
<br />
I've searched the net high and low and could not find any reason for requiring single statements to be encapsulated in do-while(0). Could you give an example here of code that breaks when disregarding this rule?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 19.10]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=948</link>
			<pubDate>Tue, 12 Mar 2013 12:45:44 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=2518">Tobias Gradl</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=948</guid>
			<description><![CDATA[I have a violation in MISRA 2004 rule 19.10: <br />
    unparenthesized macro parameter in definition of macro: '__identifier'<br />
and a violation in MISRA 2004 rule 19.4:<br />
    disallowed definition for macro '__identifier'<br />
<br />
but i don't have a macro '__identifier' in my sourcecode.<br />
<br />
Does MISRA 2004 allow include-blockers like<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#ifndef EXAMPLE_H<br />
#define EXAMPLE_H<br />
...<br />
#endif</code></div></div>or not? I assume that this may cause the errors above.<br />
<br />
Best Regards<br />
Tobias Gradl]]></description>
			<content:encoded><![CDATA[I have a violation in MISRA 2004 rule 19.10: <br />
    unparenthesized macro parameter in definition of macro: '__identifier'<br />
and a violation in MISRA 2004 rule 19.4:<br />
    disallowed definition for macro '__identifier'<br />
<br />
but i don't have a macro '__identifier' in my sourcecode.<br />
<br />
Does MISRA 2004 allow include-blockers like<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#ifndef EXAMPLE_H<br />
#define EXAMPLE_H<br />
...<br />
#endif</code></div></div>or not? I assume that this may cause the errors above.<br />
<br />
Best Regards<br />
Tobias Gradl]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 19.3 - #include... - what about directories?]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=909</link>
			<pubDate>Fri, 20 Jul 2012 16:53:03 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=2168">SafeT</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=909</guid>
			<description><![CDATA[Hi,<br />
<br />
Question about rule 19.3 -<br />
<br />
I read this rule as forbidding constructs such as:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "foo/bar/baz.c"</code></div></div>and especially things like<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "/usr/local/include/baz.h"<br />
#include "C:/Windows/blah/baz.h"</code></div></div><br />
because there is <span style="font-weight: bold;" class="mycode_b">directory information</span> following the #include keyword (it's not just a filename).<br />
<br />
It's not clear to me whether or not the above example would violate rule 19.3 - can you please weigh in?<br />
<br />
I think the use of absolute *or* relative directories on a #include line is a maintenance nightmare and can lead to unintended (read: incorrect) header files being included, especially as code is refactored and as source files are moved around. <br />
<br />
My opinion (and my experience in safety-critical systems) is that #include directives should only specify a filename, not a path of any kind, and the build configuration should specify the appropriate directories to search, and in what order.<br />
<br />
Can you please comment?<br />
<br />
(David (or anyone from MISRA)) - I have some comments (such as this one) regarding the review draft copy of MISRA-C3, but I missed the deadline of May 31 for submitting comments.  Is it too late?   You can contact me through the email on my account or PM if that is better, thanks!)]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
Question about rule 19.3 -<br />
<br />
I read this rule as forbidding constructs such as:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "foo/bar/baz.c"</code></div></div>and especially things like<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "/usr/local/include/baz.h"<br />
#include "C:/Windows/blah/baz.h"</code></div></div><br />
because there is <span style="font-weight: bold;" class="mycode_b">directory information</span> following the #include keyword (it's not just a filename).<br />
<br />
It's not clear to me whether or not the above example would violate rule 19.3 - can you please weigh in?<br />
<br />
I think the use of absolute *or* relative directories on a #include line is a maintenance nightmare and can lead to unintended (read: incorrect) header files being included, especially as code is refactored and as source files are moved around. <br />
<br />
My opinion (and my experience in safety-critical systems) is that #include directives should only specify a filename, not a path of any kind, and the build configuration should specify the appropriate directories to search, and in what order.<br />
<br />
Can you please comment?<br />
<br />
(David (or anyone from MISRA)) - I have some comments (such as this one) regarding the review draft copy of MISRA-C3, but I missed the deadline of May 31 for submitting comments.  Is it too late?   You can contact me through the email on my account or PM if that is better, thanks!)]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[19.13 and Assembly]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=892</link>
			<pubDate>Wed, 18 Apr 2012 20:08:18 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=64">gs</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=892</guid>
			<description><![CDATA[Does the following code violate rule #19.13?<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define QWER { asm ASDF #&#36;7F; }</code></div></div>In this case, "&#36;" means "value" and "#" means "address of" and is not the pasting operator.]]></description>
			<content:encoded><![CDATA[Does the following code violate rule #19.13?<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define QWER { asm ASDF #&#36;7F; }</code></div></div>In this case, "&#36;" means "value" and "#" means "address of" and is not the pasting operator.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 19.7 - Function-like macro]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=861</link>
			<pubDate>Tue, 08 Nov 2011 16:05:29 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=1817">patopat</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=861</guid>
			<description><![CDATA[I have a violation of <span style="font-weight: bold;" class="mycode_b">MISRA 2004 Advisory Rule 19.7</span>, Function-like macro defined: '<span style="font-weight: bold;" class="mycode_b">CONV</span>'<br />
<br />
#define F_MIN        (-0.5)<br />
#define F_MAX        (0.5)<br />
<span style="font-weight: bold;" class="mycode_b">#define CONV(x)      ((int32_t) ((x) &lt; F_MAX ? ((x) &gt;= F_MIN ? (x)*0x80000000U : 0xFFFF8000U) : 0x7fff0000U))</span><br />
<br />
int32_t   myVariable = <span style="font-weight: bold;" class="mycode_b">CONV(0.25)</span>;  /* the preprocessor replace macro with the value <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">0x20000000</span></span> */<br />
<br />
How I declare the macro CONV(), which is not a function but really a preprocessor task, to be compliant to MISRA ?<br />
<br />
BR,<br />
<br />
Pat]]></description>
			<content:encoded><![CDATA[I have a violation of <span style="font-weight: bold;" class="mycode_b">MISRA 2004 Advisory Rule 19.7</span>, Function-like macro defined: '<span style="font-weight: bold;" class="mycode_b">CONV</span>'<br />
<br />
#define F_MIN        (-0.5)<br />
#define F_MAX        (0.5)<br />
<span style="font-weight: bold;" class="mycode_b">#define CONV(x)      ((int32_t) ((x) &lt; F_MAX ? ((x) &gt;= F_MIN ? (x)*0x80000000U : 0xFFFF8000U) : 0x7fff0000U))</span><br />
<br />
int32_t   myVariable = <span style="font-weight: bold;" class="mycode_b">CONV(0.25)</span>;  /* the preprocessor replace macro with the value <span style="font-style: italic;" class="mycode_i"><span style="font-weight: bold;" class="mycode_b">0x20000000</span></span> */<br />
<br />
How I declare the macro CONV(), which is not a function but really a preprocessor task, to be compliant to MISRA ?<br />
<br />
BR,<br />
<br />
Pat]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 19.14 - multiple defines]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=847</link>
			<pubDate>Thu, 15 Sep 2011 17:55:41 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=1743">JohnC</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=847</guid>
			<description><![CDATA[Is this permissible under rule 19.14?<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define X ((defined(Y)) || (defined(Z)))<br />
#if X<br />
...<br />
#endif</code></div></div><br />
JohnC.]]></description>
			<content:encoded><![CDATA[Is this permissible under rule 19.14?<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define X ((defined(Y)) || (defined(Z)))<br />
#if X<br />
...<br />
#endif</code></div></div><br />
JohnC.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[19.4 - is typedef considered to be a type qualifier?]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=823</link>
			<pubDate>Thu, 14 Apr 2011 16:07:32 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=295">mishak</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=823</guid>
			<description><![CDATA[The C standard states that "The typedef specifier is called a â€˜â€˜storage-class specifierâ€™â€™ for syntactic convenience only;".<br />
<br />
Does 19.4 allow a macro to expand to 'typedef'?]]></description>
			<content:encoded><![CDATA[The C standard states that "The typedef specifier is called a â€˜â€˜storage-class specifierâ€™â€™ for syntactic convenience only;".<br />
<br />
Does 19.4 allow a macro to expand to 'typedef'?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Identifier used as variable and function-like macro]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=818</link>
			<pubDate>Wed, 23 Mar 2011 16:49:52 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=159">dcrocker</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=818</guid>
			<description><![CDATA[I recently came across some code similar to the following:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define Sum(_x, _y) ((_x) + (_y))<br />
<br />
int Sum;</code></div></div>The identifier Sum is used both as the name of a function-like macro and as the name of a variable. Does this violate any MISRA-C 2004 rules? The occurrence of the identifier Sum in the variable declaration is not an instantiation of the macro, because the following preprocessing token is not '(' (section 6.8.3 of the C90 standard), so it appears that rule 19.8 does not apply. It might be considered that rule 5.6 is violated, but section 6.1.2.3 of the standard does not mention a namespace for preprocessor macro names. It could also be considered that rule 5.7 is violated, depending on the interpretation of the word "reused".]]></description>
			<content:encoded><![CDATA[I recently came across some code similar to the following:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define Sum(_x, _y) ((_x) + (_y))<br />
<br />
int Sum;</code></div></div>The identifier Sum is used both as the name of a function-like macro and as the name of a variable. Does this violate any MISRA-C 2004 rules? The occurrence of the identifier Sum in the variable declaration is not an instantiation of the macro, because the following preprocessing token is not '(' (section 6.8.3 of the C90 standard), so it appears that rule 19.8 does not apply. It might be considered that rule 5.6 is violated, but section 6.1.2.3 of the standard does not mention a namespace for preprocessor macro names. It could also be considered that rule 5.7 is violated, depending on the interpretation of the word "reused".]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[19.4 do while(0)]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=793</link>
			<pubDate>Wed, 17 Nov 2010 11:06:49 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=436">Lundin</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=793</guid>
			<description><![CDATA[I would recommend the committee to rephrase rule 19.4 so that it does not allow do-while-zero inside function-like macros.<br />
<br />
The do-while-zero mechanism has only two purposes:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/* "goto wrapper" */<br />
do<br />
{<br />
&nbsp;&nbsp;if(something)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;break;<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;...<br />
} while(0);</code></div></div>The above code is a "hack" to stay compliant with rule 14.4 (goto shall not be used). But it surely leads to even less readable code than goto does.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/* "if-statement fiasco saver" */<br />
#define FUNC(x) do<br />
{<br />
&nbsp;&nbsp;do_this();<br />
&nbsp;&nbsp;do_that();<br />
} while(0)&nbsp;&nbsp;/* no semicolon here, as enforced by 19.4 */<br />
<br />
if(something)<br />
&nbsp;&nbsp;FUNC(X); /* the macro allows the semicolon to be placed here */<br />
else</code></div></div>The above is a "hack" that only applies to code non-compliant to rule 14.9 (if shall be followed by a compound statement). The sole purpose of do-while-zero is to save non-compliant code from the compiler errors it would otherwise receive! If the macro was written as two braces without the do while, there would be a compiler error because of the semicolon.<br />
<br />
To sum this up: if code is to conform with (required) rules 14.4 and 14.9, then there is no reason for rule 19.4 to allow do-while-zero.]]></description>
			<content:encoded><![CDATA[I would recommend the committee to rephrase rule 19.4 so that it does not allow do-while-zero inside function-like macros.<br />
<br />
The do-while-zero mechanism has only two purposes:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/* "goto wrapper" */<br />
do<br />
{<br />
&nbsp;&nbsp;if(something)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;break;<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;...<br />
} while(0);</code></div></div>The above code is a "hack" to stay compliant with rule 14.4 (goto shall not be used). But it surely leads to even less readable code than goto does.<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>/* "if-statement fiasco saver" */<br />
#define FUNC(x) do<br />
{<br />
&nbsp;&nbsp;do_this();<br />
&nbsp;&nbsp;do_that();<br />
} while(0)&nbsp;&nbsp;/* no semicolon here, as enforced by 19.4 */<br />
<br />
if(something)<br />
&nbsp;&nbsp;FUNC(X); /* the macro allows the semicolon to be placed here */<br />
else</code></div></div>The above is a "hack" that only applies to code non-compliant to rule 14.9 (if shall be followed by a compound statement). The sole purpose of do-while-zero is to save non-compliant code from the compiler errors it would otherwise receive! If the macro was written as two braces without the do while, there would be a compiler error because of the semicolon.<br />
<br />
To sum this up: if code is to conform with (required) rules 14.4 and 14.9, then there is no reason for rule 19.4 to allow do-while-zero.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 19.15 #include ssyntax, bad name]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=712</link>
			<pubDate>Tue, 02 Mar 2010 15:54:48 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=955">mshearer123</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=712</guid>
			<description><![CDATA[Hi,<br />
<br />
My header files all include #ifndef / #define 's to stop them being included twice, however apparently the name is bad.<br />
<br />
i have things like<br />
#ifndef __DMA_h<br />
#define __DMA_h<br />
#endif<br />
<br />
<br />
and <br />
<br />
#ifndef __flash_h<br />
#define __flash_h<br />
#endif<br />
<br />
Also changing to the following gives the same error<br />
<br />
#ifndef flash_h<br />
#define flash_h<br />
#endif<br />
<br />
any help would be great,<br />
<br />
Matt]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
My header files all include #ifndef / #define 's to stop them being included twice, however apparently the name is bad.<br />
<br />
i have things like<br />
#ifndef __DMA_h<br />
#define __DMA_h<br />
#endif<br />
<br />
<br />
and <br />
<br />
#ifndef __flash_h<br />
#define __flash_h<br />
#endif<br />
<br />
Also changing to the following gives the same error<br />
<br />
#ifndef flash_h<br />
#define flash_h<br />
#endif<br />
<br />
any help would be great,<br />
<br />
Matt]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 19.2 + TC1]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=642</link>
			<pubDate>Wed, 01 Apr 2009 20:10:42 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=745">William Forbes</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=642</guid>
			<description><![CDATA[Hi,<br />
<br />
The Technical Corrigendum 1 now allows the \ character to be used in a file name path without the need for a deviation.<br />
So what file will be included in the following:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "test&#92;x61test.h"</code></div></div><br />
The C standard says that this is undefined.<br />
Rule 1.2 bans undefined language features and thus a deviation is still required!<br />
<br />
What is the point in now allowing undefined language features in one rule to avoid the need to deviate when using a system that does not allow one to write compliant code only to need a deviation against another rule. TC1 does not rescind rule 1.2?<br />
<br />
William Forbes]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
The Technical Corrigendum 1 now allows the \ character to be used in a file name path without the need for a deviation.<br />
So what file will be included in the following:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#include "test&#92;x61test.h"</code></div></div><br />
The C standard says that this is undefined.<br />
Rule 1.2 bans undefined language features and thus a deviation is still required!<br />
<br />
What is the point in now allowing undefined language features in one rule to avoid the need to deviate when using a system that does not allow one to write compliant code only to need a deviation against another rule. TC1 does not rescind rule 1.2?<br />
<br />
William Forbes]]></content:encoded>
		</item>
	</channel>
</rss>