In SonarCloud, I get an error cpp:S1915 on the first line of a cpp file.
The line is: #include foo.h
and the message is: Remove the whitespaces before the # character.
But there isn’t white space before the # character.
In SonarQube for Visual Studio, ig also get an error for this line, but it is cpp:S1575: the file nanme doesn’t respect a regular expression (and yes, the regex isn’t respected for this file).
Could you, please provide a reproducer file for this file that has “#include foo.h”
To generate the reproducer file:
Search in the analysis log for the full path of the source file for which you want to create a reproducer (for instance, a file that contains a false-positive). You will have to use exactly this name (same case, / or \…)
Add the reproducer option to the scanner configuration:
sonar.cfamily.reproducer=“Full path to the .source file”
Re-run the scanner to generate a file named sonar-cfamily-reproducer.zip in the project folder.
Please share this file. If you think this file contains private information, let us know, and we’ll send you a private message that will allow you to send it privately.