Std::ostringstream object is wongly identified as a signed operand: L832 - Bitwise operators should not be applied to signed operands

Greetings!
On SonarQube 7.7 Developer Editon C++ build wrapper version 6.3 (build-wrapper-linux-x86-64):

‘’’
std::string BITEManager::get_error_text(unsigned short statusMessageCode, bool *success)
{
std::ostringstream ss;
ss << statusMessageCode; // Bug reported here: L832 - Bitwise operators should not be applied to signed operands

}
‘’’
It seems std::ostringstream object is wongly identified as a signed operand.

Kind regards
Matthias

Hi @MVoss,

could you please run the scanner with -Dsonar.verbose=true property and share the logs?
I believe that what happens is a misconfiguration leading to not finding some header files leading to some parsing errors -> error recovery -> false-positives.

OK, it’s uploaded here:
https://community.sonarsource.com/t/share-here-privately/11338/2

Hi @MVoss,

can you confirm that the fix for Exception handling is not recognized fixed this false-positive too?

Right, it’s gone too now.

1 Like