rspec/rules/S975/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

52 lines
1.4 KiB
Plaintext

== Why is this an issue?
It is undefined behavior if the '\' character is used between ``++<++`` and ``++>++`` delimiters or between the ``++"++`` delimiters in a header name preprocessing token.
Note that this rule is only advisory, since some environments use '\' as a file name delimiter. However, compilers for those environments often support the use of '/' in ``++#include++`` directives.
=== Noncompliant code example
[source,text]
----
#include "foo\bar.h" /* Noncompliant */
----
=== Compliant solution
[source,text]
----
#include "foo/bar.h" /* Compliant */
----
== Resources
* MISRA {cpp}:2008, 16-2-5 - The \ character should not occur in a header file name.
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== on 31 Mar 2015, 19:06:07 Evgeny Mandrikov wrote:
\[~ann.campbell.2] implementation seems more complete (SQALE, description) than this spec.
=== on 6 Apr 2015, 14:15:15 Evgeny Mandrikov wrote:
\[~ann.campbell.2] I'm wondering if SQALE is missing on purpose or not?
=== on 8 Apr 2015, 16:18:34 Ann Campbell wrote:
Nope [~evgeny.mandrikov]. Just an oversight
=== on 13 Apr 2015, 19:26:17 Evgeny Mandrikov wrote:
\[~ann.campbell.2] looks like this rule completely covered by RSPEC-955, so what do you think about CPP-1147?
=== on 20 Apr 2015, 14:03:27 Ann Campbell wrote:
deprecation added [~evgeny.mandrikov]
endif::env-github,rspecator-view[]