<?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 - MISRA-C:2004 Exemplar Suite]]></title>
		<link>https://forum.misra.org.uk/</link>
		<description><![CDATA[MISRA Discussion Forums - https://forum.misra.org.uk]]></description>
		<pubDate>Thu, 05 Nov 2026 13:03:20 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Copyright]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1403</link>
			<pubDate>Mon, 05 Mar 2018 09:47:37 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=4977">ankitshah413</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1403</guid>
			<description><![CDATA[Hello,<br />
<br />
I have one question regarding the copyright of the Exemplar Suite. I want to share this with my colleagues in my company, so am i allowed to do that?<br />
<br />
We have an internal tool for sharing , can i upload these examples there?<br />
<br />
It will be accessed in my company only.<br />
<br />
Thank you.]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
I have one question regarding the copyright of the Exemplar Suite. I want to share this with my colleagues in my company, so am i allowed to do that?<br />
<br />
We have an internal tool for sharing , can i upload these examples there?<br />
<br />
It will be accessed in my company only.<br />
<br />
Thank you.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 13.2]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1169</link>
			<pubDate>Mon, 23 Mar 2015 09:35:34 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=3646">sundarn</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1169</guid>
			<description><![CDATA[typedef unsigned char  bool;<br />
bool sensor_status;<br />
<br />
if(sensor_status) /*Rule 13.2*/<br />
{<br />
....<br />
}<br />
Is this a violation of rule 13.2 or could it be considered as effectively boolean ( Boolean by enforcement ).]]></description>
			<content:encoded><![CDATA[typedef unsigned char  bool;<br />
bool sensor_status;<br />
<br />
if(sensor_status) /*Rule 13.2*/<br />
{<br />
....<br />
}<br />
Is this a violation of rule 13.2 or could it be considered as effectively boolean ( Boolean by enforcement ).]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Will Exemplar Suite be updated for 2012?]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=999</link>
			<pubDate>Mon, 25 Nov 2013 22:27:37 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=2962">SteveTj</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=999</guid>
			<description><![CDATA[Will the MISRA-C:2004 Exemplar Suite be updated for MISRA-C:2012?<br />
<br />
Thanks!<br />
<br />
SteveTj]]></description>
			<content:encoded><![CDATA[Will the MISRA-C:2004 Exemplar Suite be updated for MISRA-C:2012?<br />
<br />
Thanks!<br />
<br />
SteveTj]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[MISRA C Exemplar suite : Compilation errors]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=919</link>
			<pubDate>Wed, 24 Oct 2012 07:35:18 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=2261">tarun.g</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=919</guid>
			<description><![CDATA[I encountered a few cases in the exemplar suite(the list mentioned below) where in any standard compiler throws an error.<br />
1. mc2_1101.c<br />
2. mc2_1102.c<br />
3. mc2_1903.c	<br />
4. mc2_1908.c<br />
5. mc2_1914.c<br />
6. mc2_1917.c  <br />
<br />
Are all the cases(but the ones which explicitly mention that the compiler is to fail) in the exemplar suite, in general, expected to <br />
be successfully compiled by a "MISRA standard complaint" compiler?]]></description>
			<content:encoded><![CDATA[I encountered a few cases in the exemplar suite(the list mentioned below) where in any standard compiler throws an error.<br />
1. mc2_1101.c<br />
2. mc2_1102.c<br />
3. mc2_1903.c	<br />
4. mc2_1908.c<br />
5. mc2_1914.c<br />
6. mc2_1917.c  <br />
<br />
Are all the cases(but the ones which explicitly mention that the compiler is to fail) in the exemplar suite, in general, expected to <br />
be successfully compiled by a "MISRA standard complaint" compiler?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Copyright]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=895</link>
			<pubDate>Wed, 02 May 2012 10:22:00 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=2039">Schmidt</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=895</guid>
			<description><![CDATA[Hello,<br />
I want to use the Exemplar Suite for the validation of a static code analyzer. Is it allowed to use copies of some of the files in my validation documentation? The documentation is only for internal use.]]></description>
			<content:encoded><![CDATA[Hello,<br />
I want to use the Exemplar Suite for the validation of a static code analyzer. Is it allowed to use copies of some of the files in my validation documentation? The documentation is only for internal use.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[function]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=798</link>
			<pubDate>Thu, 06 Jan 2011 06:40:22 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=1383">mit_it</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=798</guid>
			<description><![CDATA[i am defining a fucntion and getting error just starting braces "Function declared at block scope"<br />
'and Inserted ';' token in an attempt to continue parsing.<br />
<br />
I have checked expalnation but didnt get proper resembles with my problem.]]></description>
			<content:encoded><![CDATA[i am defining a fucntion and getting error just starting braces "Function declared at block scope"<br />
'and Inserted ';' token in an attempt to continue parsing.<br />
<br />
I have checked expalnation but didnt get proper resembles with my problem.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Example for 12.06 violates 2.3]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=768</link>
			<pubDate>Mon, 23 Aug 2010 16:36:28 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=1122">grafitemis</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=768</guid>
			<description><![CDATA[It seems that the comments in mc2_12.06.c violate Rule 2.3:<br />
if ( mc2_1206_boolean_a &amp; mc2_1206_boolean_b  )  /* Not Compliant -<br />
                                     /* bitwise operation on boolean operands */<br />
   {<br />
      ;<br />
   }<br />
<br />
Regards,<br />
<br />
Andreas]]></description>
			<content:encoded><![CDATA[It seems that the comments in mc2_12.06.c violate Rule 2.3:<br />
if ( mc2_1206_boolean_a &amp; mc2_1206_boolean_b  )  /* Not Compliant -<br />
                                     /* bitwise operation on boolean operands */<br />
   {<br />
      ;<br />
   }<br />
<br />
Regards,<br />
<br />
Andreas]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Example for rule 10.1]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=757</link>
			<pubDate>Wed, 21 Jul 2010 07:37:23 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=1034">raghaw_k</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=757</guid>
			<description><![CDATA[as per the misra-c writtent in one of its reply that -<br />
Rules 10.1 and 10.3 were designed with signed and unsigned expressions in mind. The treatment of enums, bitfields, chars, relational operators ( &lt; , , &gt;= ), logical operators ( &amp;&amp;, || ) and equality operators ( ==, != ) do not fit this model as yet. <br />
<br />
But in Exempler test file mc2_1001.c line number 221<br />
 if ( u16r == 1 )                 /* Not Compliant */<br />
<br />
So if == operator do not fit in the 10.1 model then Why this line is Not Cpmpliant?]]></description>
			<content:encoded><![CDATA[as per the misra-c writtent in one of its reply that -<br />
Rules 10.1 and 10.3 were designed with signed and unsigned expressions in mind. The treatment of enums, bitfields, chars, relational operators ( &lt; , , &gt;= ), logical operators ( &amp;&amp;, || ) and equality operators ( ==, != ) do not fit this model as yet. <br />
<br />
But in Exempler test file mc2_1001.c line number 221<br />
 if ( u16r == 1 )                 /* Not Compliant */<br />
<br />
So if == operator do not fit in the 10.1 model then Why this line is Not Cpmpliant?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Incorrect comment in mc2_1703.c]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=583</link>
			<pubDate>Wed, 17 Sep 2008 13:27:40 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=285">Graham Andrews</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=583</guid>
			<description><![CDATA[There is a comment regarding line:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>else if ( ( &amp;array_12 [ 12 ] - &amp;array_12 [ index_1 ] ) &gt; 0 )</code></div></div>The comment states that this line violates rule 17.4, which is not the case, as the variable array_12 has been declared as an array.<br />
It should state that there is a violation of rule 21.1 regarding <span style="font-weight: bold;" class="mycode_b"><span style="font-style: italic;" class="mycode_i">array bound errors</span></span>.]]></description>
			<content:encoded><![CDATA[There is a comment regarding line:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>else if ( ( &amp;array_12 [ 12 ] - &amp;array_12 [ index_1 ] ) &gt; 0 )</code></div></div>The comment states that this line violates rule 17.4, which is not the case, as the variable array_12 has been declared as an array.<br />
It should state that there is a violation of rule 21.1 regarding <span style="font-weight: bold;" class="mycode_b"><span style="font-style: italic;" class="mycode_i">array bound errors</span></span>.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Incorrect comment in mc2_2001.c]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=564</link>
			<pubDate>Fri, 25 Jul 2008 11:01:21 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=331">william.forbes</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=564</guid>
			<description><![CDATA[In line 42<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>/* 7.13.3 to* where * is a lower case letter */</blockquote>
should read<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>/* 7.13.<span style="font-weight: bold;" class="mycode_b">2</span> to* where * is a lower case letter */</blockquote>
i think.<br />
<br />
Bill Forbes.]]></description>
			<content:encoded><![CDATA[In line 42<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>/* 7.13.3 to* where * is a lower case letter */</blockquote>
should read<br />
<blockquote class="mycode_quote"><cite>Quote:</cite>/* 7.13.<span style="font-weight: bold;" class="mycode_b">2</span> to* where * is a lower case letter */</blockquote>
i think.<br />
<br />
Bill Forbes.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[12.6 boolean expression assigned to int example]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=515</link>
			<pubDate>Wed, 14 May 2008 09:15:00 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=368">pkruk</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=515</guid>
			<description><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>uint16_t mc2_1206_x;<br />
&nbsp;&nbsp; uint16_t mc2_1206_y;<br />
&nbsp;&nbsp; uint16_t mc2_1206_z;<br />
&nbsp;&nbsp; mc2_1206_x = ( mc2_1206_y == mc2_1206_z ); /* Not compliant - mc2_1206_x is not effectively boolean */</code></div></div><br />
This code has been marked as violation of rule 12.6 but I fail to see why. There are no  (&amp;&amp;, || and !) operators so the first part of the rule does not apply. The boolean expression is used as operand of "=" so the second part of the rule is complied to as well.<br />
Please correct me if I'm wrong.]]></description>
			<content:encoded><![CDATA[<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>uint16_t mc2_1206_x;<br />
&nbsp;&nbsp; uint16_t mc2_1206_y;<br />
&nbsp;&nbsp; uint16_t mc2_1206_z;<br />
&nbsp;&nbsp; mc2_1206_x = ( mc2_1206_y == mc2_1206_z ); /* Not compliant - mc2_1206_x is not effectively boolean */</code></div></div><br />
This code has been marked as violation of rule 12.6 but I fail to see why. There are no  (&amp;&amp;, || and !) operators so the first part of the rule does not apply. The boolean expression is used as operand of "=" so the second part of the rule is complied to as well.<br />
Please correct me if I'm wrong.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 12.2 and "nested assignment statements"]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=514</link>
			<pubDate>Wed, 14 May 2008 07:42:12 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=368">pkruk</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=514</guid>
			<description><![CDATA[Example from mc2_1203.c:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>mc2_1203_x = sizeof ( mc2_1203_a = 1234U );</code></div></div><br />
Is this code also a violation of rule 12.2 "nested assignment statements"?]]></description>
			<content:encoded><![CDATA[Example from mc2_1203.c:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>mc2_1203_x = sizeof ( mc2_1203_a = 1234U );</code></div></div><br />
Is this code also a violation of rule 12.2 "nested assignment statements"?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 8.3 - incorrect example or missing comment]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=509</link>
			<pubDate>Mon, 12 May 2008 13:04:49 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=368">pkruk</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=509</guid>
			<description><![CDATA[Function declaration in mc2_0803.h:<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>extern void mc2_0803_2 ( my_s32bit_int param0803 );</code></div></div>Function definition in mc2_0803_2.c: <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>void mc2_0803_2 ( my_other_s32bit_int param0803 )</code></div></div><br />
The types are different (different typedef names) - either there should be "Not Compliant" comment or the type should be changed.]]></description>
			<content:encoded><![CDATA[Function declaration in mc2_0803.h:<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>extern void mc2_0803_2 ( my_s32bit_int param0803 );</code></div></div>Function definition in mc2_0803_2.c: <div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>void mc2_0803_2 ( my_other_s32bit_int param0803 )</code></div></div><br />
The types are different (different typedef names) - either there should be "Not Compliant" comment or the type should be changed.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 19.9 - incorrect comment in mc2_1909.c?]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=508</link>
			<pubDate>Fri, 09 May 2008 14:21:10 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=368">pkruk</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=508</guid>
			<description><![CDATA[mc2_1909.c contains following code:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define SUM(A,B,C) ((A) + (B) + (C)) /* Violates Rule 17.4 */</code></div></div><br />
Rule 17.4 is "Array indexing shall be the only allowed form of pointer arithmetic." - the code does not seem to be violation of this rule.]]></description>
			<content:encoded><![CDATA[mc2_1909.c contains following code:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#define SUM(A,B,C) ((A) + (B) + (C)) /* Violates Rule 17.4 */</code></div></div><br />
Rule 17.4 is "Array indexing shall be the only allowed form of pointer arithmetic." - the code does not seem to be violation of this rule.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Rule 4.1 Question]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=501</link>
			<pubDate>Thu, 01 May 2008 14:49:12 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=579">fbdog</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=501</guid>
			<description><![CDATA[Hello,<br />
<br />
I was just wondering if anybody has come across a possible discrepancy with the Exemplar Test suite 4.1.  In the MISRA 2004 standard, Rule 4.1 states that "Only those escape sequences that are defined in the ISO C Standard shall be used".  Section 5.2.2 of the ISO C standard lists valid escape sequences, but section 6.4.4.4 in the ISO C Standard also further defines escape clauses that are used.<br />
<br />
The Rule 4.1 test case lists hexadecimal escape clauses as being non-compliant, but section 6.4.4.4 in the ISO C Standard indicates that hexadecimal clauses are valid.<br />
<br />
I am just wondering if anybody has considered this is as a mistake in the test suite?<br />
<br />
Thanks,<br />
Jerry]]></description>
			<content:encoded><![CDATA[Hello,<br />
<br />
I was just wondering if anybody has come across a possible discrepancy with the Exemplar Test suite 4.1.  In the MISRA 2004 standard, Rule 4.1 states that "Only those escape sequences that are defined in the ISO C Standard shall be used".  Section 5.2.2 of the ISO C standard lists valid escape sequences, but section 6.4.4.4 in the ISO C Standard also further defines escape clauses that are used.<br />
<br />
The Rule 4.1 test case lists hexadecimal escape clauses as being non-compliant, but section 6.4.4.4 in the ISO C Standard indicates that hexadecimal clauses are valid.<br />
<br />
I am just wondering if anybody has considered this is as a mistake in the test suite?<br />
<br />
Thanks,<br />
Jerry]]></content:encoded>
		</item>
	</channel>
</rss>