
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
33 lines
792 B
Plaintext
33 lines
792 B
Plaintext
== Why is this an issue?
|
|
|
|
The use of unions to access an object in different ways may result in the data being misinterpreted. Therefore, this rule prohibits the use of unions for any purpose.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,cpp]
|
|
----
|
|
union U1 { // Noncompliant
|
|
float j;
|
|
int i;
|
|
};
|
|
----
|
|
|
|
|
|
== Resources
|
|
|
|
* MISRA C:2004, 18.4 - Unions shall not be used.
|
|
* MISRA {cpp}:2008, 9-5-1 - Unions shall not be used.
|
|
* MISRA C:2012, 19.2 - The union keyword should not be used
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 13 Apr 2015, 19:31:16 Evgeny Mandrikov wrote:
|
|
\[~ann.campbell.2] I'm wondering why blocker, but not active by default? Note that in implementation currently major and active.
|
|
|
|
endif::env-github,rspecator-view[]
|