[S1764] Identical expressions in combination with macros

In C++ the rule S1764 “Identical expressions should not be used on both sides of a binary operator” is triggered even on macro constants.
Example: static_assert(CHAR_BIT == 8);
While technically correct this is counter-productive.

SonarQube 9.3
CFamily Code Quality and Security 6.30.0.42324 (cpp)

Hello @mpt,

Thank you for the report. I agree that the report is false positive and the issue should not be raised in that case. I have created an CPP-3666 ticket for the issue, and you can use it, to track its status.

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