<?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 - C++ General]]></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:27 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Enabling engagement from open source communities]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1626</link>
			<pubDate>Mon, 04 Jul 2022 09:51:08 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=5935">Kim Viggedal</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1626</guid>
			<description><![CDATA[In the interest of promoting best practices in developing safety- and security-related electronic systems and other software-intensive applications it would arguably be important to make coding guidelines, such as the coming version of MISRA C++ guidelines, highly available for anyone to use.<br />
<br />
The open source community has been reluctant to try to implement support for checking compliance with previous MISRA C++ Guidelines in static analysis tools because they are not openly published. I'm proposing that it would be of great value to the automotive industry as a whole if MISRA C++ Guidelines were published under a copyright license which explicitly allows free use of the guidelines e.g. for use as a specification for implementing support for the Guidelines in opens source static analysis tools.<br />
<br />
Is there anything currently preventing MISRA from taking such an approach to publishing of guidelines?]]></description>
			<content:encoded><![CDATA[In the interest of promoting best practices in developing safety- and security-related electronic systems and other software-intensive applications it would arguably be important to make coding guidelines, such as the coming version of MISRA C++ guidelines, highly available for anyone to use.<br />
<br />
The open source community has been reluctant to try to implement support for checking compliance with previous MISRA C++ Guidelines in static analysis tools because they are not openly published. I'm proposing that it would be of great value to the automotive industry as a whole if MISRA C++ Guidelines were published under a copyright license which explicitly allows free use of the guidelines e.g. for use as a specification for implementing support for the Guidelines in opens source static analysis tools.<br />
<br />
Is there anything currently preventing MISRA from taking such an approach to publishing of guidelines?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[MISRA C++ 2008 Example Suite]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1479</link>
			<pubDate>Fri, 08 Mar 2019 06:24:16 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=4677">jungsun.goh</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1479</guid>
			<description><![CDATA[I could not find the MISRA C ++ 2008 example suites.<br />
There is only MISRA C related stuff in Resources.<br />
Is there MISRA C ++ 2008 example suites deployment plan?]]></description>
			<content:encoded><![CDATA[I could not find the MISRA C ++ 2008 example suites.<br />
There is only MISRA C related stuff in Resources.<br />
Is there MISRA C ++ 2008 example suites deployment plan?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[MISRA C++ Working Group membership]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1462</link>
			<pubDate>Wed, 16 Jan 2019 22:20:40 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=5189">vladisld</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1462</guid>
			<description><![CDATA[Few questions about MISRA C++ Working Group and its membership:<br />
<br />
1. What is the process of applying for the membership in the C++ Working Group for the company? What are the requirements for such membership ?<br />
2. How often the working group meetings are taking place ? <br />
<br />
Thanks<br />
Vlad]]></description>
			<content:encoded><![CDATA[Few questions about MISRA C++ Working Group and its membership:<br />
<br />
1. What is the process of applying for the membership in the C++ Working Group for the company? What are the requirements for such membership ?<br />
2. How often the working group meetings are taking place ? <br />
<br />
Thanks<br />
Vlad]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Certified C++ Standard Library]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1458</link>
			<pubDate>Wed, 10 Oct 2018 02:22:12 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=5007">dejanpan</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1458</guid>
			<description><![CDATA[Hi there.  We are working on the automotive framework for programming of autonomous cars. Our framework has features that are very similar to those in Adaptive Autosar: <a href="https://www.autosar.org/standards/adaptive-platform/" target="_blank" rel="noopener" class="mycode_url">https://www.autosar.org/standards/adaptive-platform/</a>. We plan to certify this framework as a Safety Element Out of Context according to ISO 26262.<br />
<br />
The framework is written in C++ and makes rather heavy use of constructs implemented in Standard Library (see below for the full list). Many C++ keywords like throw or lambdas use the C++ standard library. So removing the C++ standard library would lead to a dysfunctional compiler.<br />
<br />
We are aware of 3 Standard Library implementations:<br />
1. LLVM libc++: <a href="https://libcxx.llvm.org/docs/" target="_blank" rel="noopener" class="mycode_url">https://libcxx.llvm.org/docs/</a> <br />
2. GCC libstdc++: <a href="https://gcc.gnu.org/" target="_blank" rel="noopener" class="mycode_url">https://gcc.gnu.org/</a> <br />
3. Dinkumware: <a href="https://www.dinkumware.com/" target="_blank" rel="noopener" class="mycode_url">https://www.dinkumware.com/</a> <br />
<br />
Now the problem is that none of the above libraries are certified according to ISO 26262. <br />
<br />
Questions:  <br />
1. **Are you aware of any ISO 26262 certified Standard Library? Or anybody that is working on it?**<br />
2. **Would any of the above implementations qualify for a â€œproven in useâ€ argument?**<br />
<br />
<br />
Constructs in our framework used from the Standard Library:<br />
```cpp<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />tring<br />
std::vector<br />
std::map<br />
std::unordered_map<br />
std::allocator<br />
std::allocator_traits<br />
<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />hared_ptr<br />
std::make_shared<br />
std::unique_ptr<br />
std::make_unique<br />
std::weak_ptr<br />
<br />
std::enable_shared_from_this<br />
<br />
std::move<br />
<br />
std::ostream<br />
std::ostringstream<br />
<br />
std::lock_guard<br />
std::mutex<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />hared_future<br />
std::thread::hardware_concurrency<br />
std::this_thread::yield()<br />
<br />
std::enable_if<br />
std::false_type<br />
std::is_same<br />
std::declval<br />
<br />
std::function<br />
std::bind<br />
<br />
std::chrono*<br />
<br />
std::numeric_limits<br />
<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />hared_future<br />
<br />
std::runtime_error<br />
std::invalid_argument<br />
<br />
std::int32_t<br />
std::type_index<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />nprintf<br />
```]]></description>
			<content:encoded><![CDATA[Hi there.  We are working on the automotive framework for programming of autonomous cars. Our framework has features that are very similar to those in Adaptive Autosar: <a href="https://www.autosar.org/standards/adaptive-platform/" target="_blank" rel="noopener" class="mycode_url">https://www.autosar.org/standards/adaptive-platform/</a>. We plan to certify this framework as a Safety Element Out of Context according to ISO 26262.<br />
<br />
The framework is written in C++ and makes rather heavy use of constructs implemented in Standard Library (see below for the full list). Many C++ keywords like throw or lambdas use the C++ standard library. So removing the C++ standard library would lead to a dysfunctional compiler.<br />
<br />
We are aware of 3 Standard Library implementations:<br />
1. LLVM libc++: <a href="https://libcxx.llvm.org/docs/" target="_blank" rel="noopener" class="mycode_url">https://libcxx.llvm.org/docs/</a> <br />
2. GCC libstdc++: <a href="https://gcc.gnu.org/" target="_blank" rel="noopener" class="mycode_url">https://gcc.gnu.org/</a> <br />
3. Dinkumware: <a href="https://www.dinkumware.com/" target="_blank" rel="noopener" class="mycode_url">https://www.dinkumware.com/</a> <br />
<br />
Now the problem is that none of the above libraries are certified according to ISO 26262. <br />
<br />
Questions:  <br />
1. **Are you aware of any ISO 26262 certified Standard Library? Or anybody that is working on it?**<br />
2. **Would any of the above implementations qualify for a â€œproven in useâ€ argument?**<br />
<br />
<br />
Constructs in our framework used from the Standard Library:<br />
```cpp<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />tring<br />
std::vector<br />
std::map<br />
std::unordered_map<br />
std::allocator<br />
std::allocator_traits<br />
<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />hared_ptr<br />
std::make_shared<br />
std::unique_ptr<br />
std::make_unique<br />
std::weak_ptr<br />
<br />
std::enable_shared_from_this<br />
<br />
std::move<br />
<br />
std::ostream<br />
std::ostringstream<br />
<br />
std::lock_guard<br />
std::mutex<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />hared_future<br />
std::thread::hardware_concurrency<br />
std::this_thread::yield()<br />
<br />
std::enable_if<br />
std::false_type<br />
std::is_same<br />
std::declval<br />
<br />
std::function<br />
std::bind<br />
<br />
std::chrono*<br />
<br />
std::numeric_limits<br />
<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />hared_future<br />
<br />
std::runtime_error<br />
std::invalid_argument<br />
<br />
std::int32_t<br />
std::type_index<br />
std:<img src="https://forum.misra.org.uk/images/smilies/confused.png" alt="Confused" title="Confused" class="smilie smilie_13" />nprintf<br />
```]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Proposal: Consider adding a rule for the undefined behaviour in ISO/IEC 14882:2003 3.6.2 section 3]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1449</link>
			<pubDate>Wed, 15 Aug 2018 09:16:59 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=4389">dg1980</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1449</guid>
			<description><![CDATA[Hi,<br />
<br />
as far as i know, there is no explicit rule to deal with that.<br />
12-8-1 comes close but is for copy constructors only.<br />
<br />
An implementation is permitted to perform the initialization of an object of namespace scope with static<br />
storage duration as a static initialization even if such initialization is not required to be done statically, provided<br />
that<br />
â€” the dynamic version of the initialization does not change the value of any other object of namespace<br />
scope with static storage duration prior to its initialization, and<br />
â€” the static version of the initialization produces the same value in the initialized object as would be produced<br />
by the dynamic initialization if all objects not required to be initialized statically were initialized<br />
dynamically.<br />
[Note: as a consequence, if the initialization of an object obj1 refers to an object obj2 of namespace<br />
scope with static storage duration potentially requiring dynamic initialization and defined later in the same<br />
translation unit, it is <span style="font-weight: bold;" class="mycode_b">unspecified</span> whether the value of obj2 used will be the value of the fully initialized<br />
obj2 (because obj2 was statically initialized) or will be the value of obj2 merely zero-initialized. For<br />
example,<br />
44<br />
ï›™ ISO/IEC ISO/IEC 14882:2003(E)<br />
3 Basic concepts 3.6.2 Initialization of non-local objects<br />
inline double fd() { return 1.0; }<br />
extern double d1;<br />
double d2 = d1; // unspecified:<br />
// may be statically initialized to 0.0 or<br />
// dynamically initialized to 1.0<br />
double d1 = fd(); // may be initialized statically to 1.0<br />
â€”end note]<br />
3 It is <span style="font-weight: bold;" class="mycode_b">implementation-defined</span> whether or not the dynamic initialization (8.5, 9.4, 12.1, 12.6.1) of an object of<br />
namespace scope is done before the first statement of main. If the initialization is deferred to some point<br />
in time after the first statement of main, it shall occur before the first use of any function or object defined<br />
in the same translation unit as the object to be initialized.31) [Example:<br />
// â€“ File 1 â€“<br />
#include "a.h"<br />
#include "b.h"<br />
B b;<br />
A::A(){<br />
b.Use();<br />
}<br />
// â€“ File 2 â€“<br />
#include "a.h"<br />
A a;<br />
// â€“ File 3 â€“<br />
#include "a.h"<br />
#include "b.h"<br />
extern A a;<br />
extern B b;<br />
int main() {<br />
a.Use();<br />
b.Use();<br />
}<br />
It is <span style="font-weight: bold;" class="mycode_b">implementation-defined</span> whether either a or b is initialized before main is entered or whether the<br />
initializations are delayed until a is first used in main. In particular, if a is initialized before main is<br />
entered, it is <span style="font-weight: bold;" class="mycode_b">not guaranteed</span> that b will be initialized before it is used by the initialization of a, that is,<br />
before A::A is called. If, however, a is initialized at some point after the first statement of main, b will<br />
be initialized prior to its use in A::A. ]]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
as far as i know, there is no explicit rule to deal with that.<br />
12-8-1 comes close but is for copy constructors only.<br />
<br />
An implementation is permitted to perform the initialization of an object of namespace scope with static<br />
storage duration as a static initialization even if such initialization is not required to be done statically, provided<br />
that<br />
â€” the dynamic version of the initialization does not change the value of any other object of namespace<br />
scope with static storage duration prior to its initialization, and<br />
â€” the static version of the initialization produces the same value in the initialized object as would be produced<br />
by the dynamic initialization if all objects not required to be initialized statically were initialized<br />
dynamically.<br />
[Note: as a consequence, if the initialization of an object obj1 refers to an object obj2 of namespace<br />
scope with static storage duration potentially requiring dynamic initialization and defined later in the same<br />
translation unit, it is <span style="font-weight: bold;" class="mycode_b">unspecified</span> whether the value of obj2 used will be the value of the fully initialized<br />
obj2 (because obj2 was statically initialized) or will be the value of obj2 merely zero-initialized. For<br />
example,<br />
44<br />
ï›™ ISO/IEC ISO/IEC 14882:2003(E)<br />
3 Basic concepts 3.6.2 Initialization of non-local objects<br />
inline double fd() { return 1.0; }<br />
extern double d1;<br />
double d2 = d1; // unspecified:<br />
// may be statically initialized to 0.0 or<br />
// dynamically initialized to 1.0<br />
double d1 = fd(); // may be initialized statically to 1.0<br />
â€”end note]<br />
3 It is <span style="font-weight: bold;" class="mycode_b">implementation-defined</span> whether or not the dynamic initialization (8.5, 9.4, 12.1, 12.6.1) of an object of<br />
namespace scope is done before the first statement of main. If the initialization is deferred to some point<br />
in time after the first statement of main, it shall occur before the first use of any function or object defined<br />
in the same translation unit as the object to be initialized.31) [Example:<br />
// â€“ File 1 â€“<br />
#include "a.h"<br />
#include "b.h"<br />
B b;<br />
A::A(){<br />
b.Use();<br />
}<br />
// â€“ File 2 â€“<br />
#include "a.h"<br />
A a;<br />
// â€“ File 3 â€“<br />
#include "a.h"<br />
#include "b.h"<br />
extern A a;<br />
extern B b;<br />
int main() {<br />
a.Use();<br />
b.Use();<br />
}<br />
It is <span style="font-weight: bold;" class="mycode_b">implementation-defined</span> whether either a or b is initialized before main is entered or whether the<br />
initializations are delayed until a is first used in main. In particular, if a is initialized before main is<br />
entered, it is <span style="font-weight: bold;" class="mycode_b">not guaranteed</span> that b will be initialized before it is used by the initialization of a, that is,<br />
before A::A is called. If, however, a is initialized at some point after the first statement of main, b will<br />
be initialized prior to its use in A::A. ]]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[C++0x]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1325</link>
			<pubDate>Wed, 15 Mar 2017 15:06:22 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=4702">aviargus</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1325</guid>
			<description><![CDATA[Hello,<br />
I wanted to know if misra-c++ is going to support c++0x (or at least some of the features)?<br />
<br />
Thanks,]]></description>
			<content:encoded><![CDATA[Hello,<br />
I wanted to know if misra-c++ is going to support c++0x (or at least some of the features)?<br />
<br />
Thanks,]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Mixed C/C++ build environment]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1284</link>
			<pubDate>Tue, 11 Oct 2016 11:40:10 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=4389">dg1980</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1284</guid>
			<description><![CDATA[Could you write an explicit chapter on how to deal with this situation in the next version of the standard?<br />
For example, i don't think this is what MISRA intended: <a href="http://support.gimpel.com/forums/225702-general/suggestions/11429436-improved-misra-checking-for-projects-with-mixed-c" target="_blank" rel="noopener" class="mycode_url">http://support.gimpel.com/forums/225702-...th-mixed-c</a><br />
Also, consider adding exceptions to some rules in the context of headers being included in both C and C++ modules:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#ifndef FOO_H<br />
#define FOO_H<br />
<br />
#define MAGIC_CONSTANT 123456/*Violates MISRA C++ Rule 16-2-2, but is fine in C and changing would require storage in C (effiency)*/<br />
typedef int int32_t;<br />
<br />
#ifdef __cplusplus<br />
extern "C"<br />
{<br />
#endif<br />
<br />
int32_t foo_api(void);<br />
<br />
#ifdef __cplusplus<br />
}<br />
#endif<br />
<br />
#endif</code></div></div><br />
Thank you very much.]]></description>
			<content:encoded><![CDATA[Could you write an explicit chapter on how to deal with this situation in the next version of the standard?<br />
For example, i don't think this is what MISRA intended: <a href="http://support.gimpel.com/forums/225702-general/suggestions/11429436-improved-misra-checking-for-projects-with-mixed-c" target="_blank" rel="noopener" class="mycode_url">http://support.gimpel.com/forums/225702-...th-mixed-c</a><br />
Also, consider adding exceptions to some rules in the context of headers being included in both C and C++ modules:<br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#ifndef FOO_H<br />
#define FOO_H<br />
<br />
#define MAGIC_CONSTANT 123456/*Violates MISRA C++ Rule 16-2-2, but is fine in C and changing would require storage in C (effiency)*/<br />
typedef int int32_t;<br />
<br />
#ifdef __cplusplus<br />
extern "C"<br />
{<br />
#endif<br />
<br />
int32_t foo_api(void);<br />
<br />
#ifdef __cplusplus<br />
}<br />
#endif<br />
<br />
#endif</code></div></div><br />
Thank you very much.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Code generators for MISRA C++]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1220</link>
			<pubDate>Mon, 04 Jan 2016 12:55:32 +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=1220</guid>
			<description><![CDATA[On the general subject of MISRA compliance and auto-code, is anyone out there using a code generating tool and trying to produce MISRA C++ 2008 compliant code ?]]></description>
			<content:encoded><![CDATA[On the general subject of MISRA compliance and auto-code, is anyone out there using a code generating tool and trying to produce MISRA C++ 2008 compliant code ?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Any upcoming releases for MISRA C++ ?]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1195</link>
			<pubDate>Tue, 21 Jul 2015 09:53:48 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=3848">daniel tuchscherer</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1195</guid>
			<description><![CDATA[Hi,<br />
<br />
As far as I know the latest guideline for C++ is MISRA C++ 2008. According to the current Cpp conferences and its talks about modern C++, the increasing use of embedded linux and during some research C++11 / C++14 both provide many techniques that could be useful for embedded programming of safety critical systems. Please correct me if I'm wrong. To name a few features there are <span style="font-style: italic;" class="mycode_i">std::array, range-loops, constexpr, static_assert, enum class</span>.<br />
<br />
Are there any upcoming MISRA C++ guidelines planned in the near future covering those (C++11, â€¦) standards ?<br />
<br />
Thanks Daniel]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
As far as I know the latest guideline for C++ is MISRA C++ 2008. According to the current Cpp conferences and its talks about modern C++, the increasing use of embedded linux and during some research C++11 / C++14 both provide many techniques that could be useful for embedded programming of safety critical systems. Please correct me if I'm wrong. To name a few features there are <span style="font-style: italic;" class="mycode_i">std::array, range-loops, constexpr, static_assert, enum class</span>.<br />
<br />
Are there any upcoming MISRA C++ guidelines planned in the near future covering those (C++11, â€¦) standards ?<br />
<br />
Thanks Daniel]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[MISRA Rules Ambiguity]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1139</link>
			<pubDate>Tue, 23 Dec 2014 20:59:43 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=3605">igor.gvero</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=1139</guid>
			<description><![CDATA[My name is Igor Gvero and I am a Product Manager/Owner at Klocwork. Our developers had few questions with respect to ambiguity of some rules. Questions are below.<br />
NOTE: THESE ARE NOT SECTION 6 INQUIRIES - SO I AM POSTING THE QUESTIONS HERE<br />
<br />
1.       Concerning the Rule 5-0-15 of the MISRA C++ 2008 standard, is the following example compliant with the rule?<br />
 <br />
struct Bar<br />
{<br />
    int32_t* dataP[2];<br />
};<br />
 <br />
void f()<br />
{<br />
    int32_t myarray[10];<br />
    Bar b;<br />
    b.dataP[0] = myarray;<br />
    b.dataP[1] = myarray;<br />
 <br />
    int32_t c = (b.dataP[1])[3];     // Is this expression compliant with the rule 5-0-15?<br />
}<br />
 <br />
                 The reason that I am asking this question is that the examples for the rule 5-0-15 seem to be contradictory about the use of pointers as arrays. For example, the following are examples from the documentation of the rule 5-0-15:<br />
 <br />
void my_fn(uint8_t * p1, uint8_t * p2[ ])<br />
{<br />
    ...<br />
    p1[ 5 ] = 0; // Non-compliant â€“ p1 was not declared as array<br />
    ...<br />
}<br />
 <br />
uint8_t a[ 10 ];<br />
uint8_t * p;<br />
p = a;<br />
p[ 5 ] = 0;    // Compliant : seems to be contradictory with the previous example where it is non-compliant.<br />
 <br />
                   I would appreciate if you could explain the exact rule for the use of pointers as arrays in your answer.<br />
 <br />
 <br />
2.       Concerning the Rule 2-10-2 of the MISRA C++ 2008 standard, is operator overloading allowed for this rule? I think it should be allowed, but I would like to be sure. The rule discuss about identifiers. An operator name should not be an identifier, thus operator overloading should be allowed, but it is not clear from the rule. For example, is the following example compliant with the rule?<br />
 <br />
#include <br />
#include <br />
 <br />
namespace myNamespace {<br />
    class myClass {<br />
      public:<br />
        static void* operator new(size_t); // Is this operator overloading compliant with rule 2-10-2?<br />
    };<br />
}<br />
 <br />
 <br />
3.       Concerning the Rule 5-0-2 of the MISRA C++ 2008 standard, can one use parentheses for the operand of the sizeof operator? The rule states that â€œParentheses are not required for the operand of a unary operatorâ€. Sizeof is unary operator, thus parentheses should not be required. However, it is common practice to use parentheses with this operator (and even some MISRA examples use this style like rule 5-3-4). Here are some examples to help understand my question:<br />
 <br />
uint8_t* a = ...;<br />
 <br />
sizeof *a;     // Should be compliant with the rule.<br />
sizeof (int);  // Should be compliant with the rule too since the operand is a cast.<br />
 <br />
sizeof(*a);    // This is the one that I am not sure of. I think that it should be accepted but the rule seems to say otherwise.]]></description>
			<content:encoded><![CDATA[My name is Igor Gvero and I am a Product Manager/Owner at Klocwork. Our developers had few questions with respect to ambiguity of some rules. Questions are below.<br />
NOTE: THESE ARE NOT SECTION 6 INQUIRIES - SO I AM POSTING THE QUESTIONS HERE<br />
<br />
1.       Concerning the Rule 5-0-15 of the MISRA C++ 2008 standard, is the following example compliant with the rule?<br />
 <br />
struct Bar<br />
{<br />
    int32_t* dataP[2];<br />
};<br />
 <br />
void f()<br />
{<br />
    int32_t myarray[10];<br />
    Bar b;<br />
    b.dataP[0] = myarray;<br />
    b.dataP[1] = myarray;<br />
 <br />
    int32_t c = (b.dataP[1])[3];     // Is this expression compliant with the rule 5-0-15?<br />
}<br />
 <br />
                 The reason that I am asking this question is that the examples for the rule 5-0-15 seem to be contradictory about the use of pointers as arrays. For example, the following are examples from the documentation of the rule 5-0-15:<br />
 <br />
void my_fn(uint8_t * p1, uint8_t * p2[ ])<br />
{<br />
    ...<br />
    p1[ 5 ] = 0; // Non-compliant â€“ p1 was not declared as array<br />
    ...<br />
}<br />
 <br />
uint8_t a[ 10 ];<br />
uint8_t * p;<br />
p = a;<br />
p[ 5 ] = 0;    // Compliant : seems to be contradictory with the previous example where it is non-compliant.<br />
 <br />
                   I would appreciate if you could explain the exact rule for the use of pointers as arrays in your answer.<br />
 <br />
 <br />
2.       Concerning the Rule 2-10-2 of the MISRA C++ 2008 standard, is operator overloading allowed for this rule? I think it should be allowed, but I would like to be sure. The rule discuss about identifiers. An operator name should not be an identifier, thus operator overloading should be allowed, but it is not clear from the rule. For example, is the following example compliant with the rule?<br />
 <br />
#include <br />
#include <br />
 <br />
namespace myNamespace {<br />
    class myClass {<br />
      public:<br />
        static void* operator new(size_t); // Is this operator overloading compliant with rule 2-10-2?<br />
    };<br />
}<br />
 <br />
 <br />
3.       Concerning the Rule 5-0-2 of the MISRA C++ 2008 standard, can one use parentheses for the operand of the sizeof operator? The rule states that â€œParentheses are not required for the operand of a unary operatorâ€. Sizeof is unary operator, thus parentheses should not be required. However, it is common practice to use parentheses with this operator (and even some MISRA examples use this style like rule 5-3-4). Here are some examples to help understand my question:<br />
 <br />
uint8_t* a = ...;<br />
 <br />
sizeof *a;     // Should be compliant with the rule.<br />
sizeof (int);  // Should be compliant with the rule too since the operand is a cast.<br />
 <br />
sizeof(*a);    // This is the one that I am not sure of. I think that it should be accepted but the rule seems to say otherwise.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Abandoned?]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=1101</link>
			<pubDate>Mon, 25 Aug 2014 16:31:21 +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=1101</guid>
			<description><![CDATA[Given the general lack of response with respect to MISRA C++ guidelines, is it fair to say MISRA C++ has been effectively "abandoned" by the committee?]]></description>
			<content:encoded><![CDATA[Given the general lack of response with respect to MISRA C++ guidelines, is it fair to say MISRA C++ has been effectively "abandoned" by the committee?]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Need for Both C and C++ Guidelines?]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=887</link>
			<pubDate>Mon, 05 Mar 2012 16:10:48 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=1987">bmbrown</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=887</guid>
			<description><![CDATA[Do the C++ guidelines stand on their own or do the C++ guidelines assume that the C guidelines are being followed as well?  Our source code is a mixture of C and C++, but it is compiled using a C++ compiler.  We are trying to determine which guideline(s) we need to acquire licenses for.]]></description>
			<content:encoded><![CDATA[Do the C++ guidelines stand on their own or do the C++ guidelines assume that the C guidelines are being followed as well?  Our source code is a mixture of C and C++, but it is compiled using a C++ compiler.  We are trying to determine which guideline(s) we need to acquire licenses for.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Exemplar suite for C++]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=707</link>
			<pubDate>Fri, 19 Feb 2010 15:20:40 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=780">azukich</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=707</guid>
			<description><![CDATA[Is there an exemplar suite for C++?  If not is this in the plans to create this?<br />
<br />
Thank you]]></description>
			<content:encoded><![CDATA[Is there an exemplar suite for C++?  If not is this in the plans to create this?<br />
<br />
Thank you]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Similarities and differences between Misra C++ and ECPP]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=559</link>
			<pubDate>Tue, 22 Jul 2008 17:02:06 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=646">gfinlay</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=559</guid>
			<description><![CDATA[I would like to hear from the Misra committee about what are some of the similarities and salient differences between the Misra-C++ 2008 standard and the work of the Embedded C++ Technical Committee (<a href="http://www.caravan.net/ec2plus/" target="_blank" rel="noopener" class="mycode_url">http://www.caravan.net/ec2plus/</a>)? Is there any difference in emphasis or goals of the two projects - e.g. safety critical vs tailoring for resource-limited systems? Perhaps this could be added to the Misra-C++ FAQ. I have used ECPP in a couple of projects with the Freescale Codewarrior C++ compiler (Coldfire version has compiler switches which turn on a EC++ subset).<br />
<br />
Gord Finlay]]></description>
			<content:encoded><![CDATA[I would like to hear from the Misra committee about what are some of the similarities and salient differences between the Misra-C++ 2008 standard and the work of the Embedded C++ Technical Committee (<a href="http://www.caravan.net/ec2plus/" target="_blank" rel="noopener" class="mycode_url">http://www.caravan.net/ec2plus/</a>)? Is there any difference in emphasis or goals of the two projects - e.g. safety critical vs tailoring for resource-limited systems? Perhaps this could be added to the Misra-C++ FAQ. I have used ECPP in a couple of projects with the Freescale Codewarrior C++ compiler (Coldfire version has compiler switches which turn on a EC++ subset).<br />
<br />
Gord Finlay]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Misra C Cross Reference]]></title>
			<link>https://forum.misra.org.uk/showthread.php?tid=537</link>
			<pubDate>Tue, 17 Jun 2008 08:07:17 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://forum.misra.org.uk/member.php?action=profile&uid=617">IanStroud</a>]]></dc:creator>
			<guid isPermaLink="false">https://forum.misra.org.uk/showthread.php?tid=537</guid>
			<description><![CDATA[Hi,<br />
<br />
We have just purchased a copy of the Misra-C++ Guideline. Not surprisingly there is a lot of commonality with the Misra C guidelines but the rules have different numbers. <br />
<br />
Is there a document that cross references the Rules between the two guidelines. In particular I would like to know:<br />
-those rules in Misra C that do not appear in Misra C++<br />
-those rules in Misra C++ that do not appear in Misra C<br />
-rules that are common to both but have been amended slightly in the C++ guidelines<br />
<br />
We have spent a lot of time going through the Misra C document seeing which Rules we think are worth adopting into our general coding standards and now wish to do the same with C++. Having a some cross reference would greatly assist this process.<br />
<br />
thanks]]></description>
			<content:encoded><![CDATA[Hi,<br />
<br />
We have just purchased a copy of the Misra-C++ Guideline. Not surprisingly there is a lot of commonality with the Misra C guidelines but the rules have different numbers. <br />
<br />
Is there a document that cross references the Rules between the two guidelines. In particular I would like to know:<br />
-those rules in Misra C that do not appear in Misra C++<br />
-those rules in Misra C++ that do not appear in Misra C<br />
-rules that are common to both but have been amended slightly in the C++ guidelines<br />
<br />
We have spent a lot of time going through the Misra C document seeing which Rules we think are worth adopting into our general coding standards and now wish to do the same with C++. Having a some cross reference would greatly assist this process.<br />
<br />
thanks]]></content:encoded>
		</item>
	</channel>
</rss>