<?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.1 General (C++)]]></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:28 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Use of constexpr]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1329</link>
			<pubDate>Fri, 31 Mar 2017 14:15:39 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=4710">mikearmagedon</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1329</guid>
			<description><![CDATA[I am working on an embedded system project and using constexpr on the following situations:<br />
 - on constructors so that objects can be statically initialized in compile time<br />
 - on functions that are used to initialize constant values<br />
 - on constant variables, as an alternative to constant macros (as it violates rule 16-2-2)<br />
<br />
The main reasons for using constexpr are (a)to avoid dynamic initialization, making the system more secure, and (b)to make better use of the system's ROM memory.<br />
<br />
The constexpr is a language extension so a deviation procedure is necessary to allow its usage.<br />
<br />
I would like to know first, if there is any way of achieving the same without the need to write a deviation procedure?<br />
<br />
If such is not possible, are the reasons above enough to justify a deviation procedure?<br />
<br />
Kind regards,<br />
Miguel AraÃºjo]]></description>
			<content:encoded><![CDATA[I am working on an embedded system project and using constexpr on the following situations:<br />
 - on constructors so that objects can be statically initialized in compile time<br />
 - on functions that are used to initialize constant values<br />
 - on constant variables, as an alternative to constant macros (as it violates rule 16-2-2)<br />
<br />
The main reasons for using constexpr are (a)to avoid dynamic initialization, making the system more secure, and (b)to make better use of the system's ROM memory.<br />
<br />
The constexpr is a language extension so a deviation procedure is necessary to allow its usage.<br />
<br />
I would like to know first, if there is any way of achieving the same without the need to write a deviation procedure?<br />
<br />
If such is not possible, are the reasons above enough to justify a deviation procedure?<br />
<br />
Kind regards,<br />
Miguel AraÃºjo]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Making constants in MISRA compliant C++]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1213</link>
			<pubDate>Mon, 09 Nov 2015 13:52:44 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=4115">Insane Vent Storm</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1213</guid>
			<description><![CDATA[I am trying to declare a constant for use in fixing the size of several C++ arrays. I have tried 3 options:<br />
1) #'define MaxTracksConst 8<br />
<br />
2) const Rhp_int32_t MaxTracksConst(8);<br />
<br />
3) enum %s {one, two, three, four, five, six, seven, MaxTracksConst}<br />
<br />
but our LDRA MISRA checker finds fault with all of them ( 1. fails 16-2-2,   2. fails 3-1-1 and 3. fails 4-5-2 ).<br />
Am I missing something, or is there an option that will pass MISRA C++ 2008 checks ?<br />
<br />
Kind regards<br />
Insane Vent Storm]]></description>
			<content:encoded><![CDATA[I am trying to declare a constant for use in fixing the size of several C++ arrays. I have tried 3 options:<br />
1) #'define MaxTracksConst 8<br />
<br />
2) const Rhp_int32_t MaxTracksConst(8);<br />
<br />
3) enum %s {one, two, three, four, five, six, seven, MaxTracksConst}<br />
<br />
but our LDRA MISRA checker finds fault with all of them ( 1. fails 16-2-2,   2. fails 3-1-1 and 3. fails 4-5-2 ).<br />
Am I missing something, or is there an option that will pass MISRA C++ 2008 checks ?<br />
<br />
Kind regards<br />
Insane Vent Storm]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[self-contained headers]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=867</link>
			<pubDate>Mon, 05 Dec 2011 08:31:09 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=1400">sthrjo</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=867</guid>
			<description><![CDATA[There is no rule in MISRA for header files to be self-contained, is there? Is there a reason for this decision? Other rule-sets has this rule, allegedly "Goddard Space Flight Center" has a rule-set for C.]]></description>
			<content:encoded><![CDATA[There is no rule in MISRA for header files to be self-contained, is there? Is there a reason for this decision? Other rule-sets has this rule, allegedly "Goddard Space Flight Center" has a rule-set for C.]]></content:encoded>
		</item>
	</channel>
</rss>