Hi,
I have a C++ project being scanned using sonarcloud. I have a whole lot of issues being raised for rule:
Non-standard characters should not occur in header file names in “#include” directives
This is classified as a bug, and with major severity. I believe it should’nt be listed as a bug. And not of major severity, maybe more like Info or Minor.
An example C++ code sample that generates this issue is:
#include “dir\foo.h”
To fix it, I want to use a forward slash. Nonetheless our code builds, and works perfectly fine without this fix.
In our project there is no bug because of this issue. This is because our Windows OS env and compiler accepts the backward slash in file paths. Even if it were a problem, the code would not even build. The issue would be caught by the compiler before it even gets to the sonarcloud static analysis.
The issue’s reference source is MISRA C++ 2008 standard rule 16-2-5 (see http://www.tlemp.com/download/rule/MISRA-CPP-2008-STANDARD.pdf). They classify the rule as Advisory. Which means it should be followed but is not required. This reinforces that it is not a bug.
Thanks