False Positive: S955

  • C++
  • S955
  • Does not match to any provided reference
  • SonarQube for Visual Studio 8.11.0.11944
  • In connected mode with Sonar Cloud

Easy to reproduce:

#include "anyfile.h"//comment

This line raises a S955 error. When inserting a space between the second double quote and the double slash, no error.
I suppose you tokenize the line by using space as sperator, and find // in what you consider as the filename (the second token). And then raise an errror according the 16-2-4 rule from MISRA C++:2008.

I know, there should be a space, but your detection is anyway faulty. :slight_smile:

Hello @Oodini,

I’ve been able to reproduce your issue, I created a ticket, and a fix is on its way.

The reason behind the issue is more subtle than what you suggested, but yes, at some point, the comment is erroneously considered as part of the filename. This issue only appears in SonarQube IDE.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.