rspec/rules/S968/cfamily/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
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.
2023-05-25 14:18:12 +02:00

34 lines
1.1 KiB
Plaintext

== Why is this an issue?
The evaluation order of both the ``++#++`` and ``++##++`` preprocessor operators is unspecified. Compilers have been known to implement these operators inconsistently, therefore, to avoid these problems, do not use them.
=== Noncompliant code example
[source,cpp]
----
#define A(Y) #Y /* Noncompliant */
#define A(X,Y) X##Y /* Noncompliant */
----
== Resources
* MISRA C:2004, 19.13 - The # and ## preprocessor operators should not be used.
* MISRA {cpp}:2008, 16-3-2 - The # and ## operators should not be used.
* MISRA C:2012, 20.10 - The # and ## preprocessor operators should not be used
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== on 6 Apr 2015, 14:13:12 Evgeny Mandrikov wrote:
\[~ann.campbell.2] implementation seems more complete (SQALE, description) than this spec.
=== on 13 Apr 2015, 19:32:33 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[]