2023-05-03 11:06:20 +02:00
== Why is this an issue?
2021-06-08 14:23:48 +02:00
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.
2023-05-03 11:06:20 +02:00
=== Noncompliant code example
2021-06-08 14:23:48 +02:00
2022-02-04 17:28:24 +01:00
[source,text]
2021-06-08 14:23:48 +02:00
----
#include "foo\bar.h" /* Noncompliant */
----
2023-05-03 11:06:20 +02:00
=== Compliant solution
2021-06-08 14:23:48 +02:00
2022-02-04 17:28:24 +01:00
[source,text]
2021-06-08 14:23:48 +02:00
----
#include "foo/bar.h" /* Compliant */
----
2023-05-03 11:06:20 +02:00
== Resources
2021-06-08 14:23:48 +02:00
* MISRA {cpp}:2008, 16-2-5 - The \ character should not occur in a header file name.
2022-01-25 18:36:46 +01:00
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
2023-05-25 14:18:12 +02:00
=== 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]
2022-01-25 18:36:46 +01:00
endif::env-github,rspecator-view[]