False Positives for C Rules L69 and L382

sonarqube

(Petermbauer) #1

hi,

i have some false positives here.
This one is quite obvious:

There are a lot of these found, it seems the detection of signed vs. unsigned does not work:

uint16_t temp;

  • SonarQube 7.3 Enterprise Edition, SonarCFamily 5.1.1.10386 (cpp)
  • minimal code sample to reproduce: see above

(Massimo Paladin) #2

Hi @petermbauer,

thank you for your report. SonarCFamily is now at version 6.0, I would suggest you to try the latest version.


(Petermbauer) #3

thx, we already planned the upgrade. Are these issues definitely fixed with 6.0 or is this just an assumption?


(Massimo Paladin) #4

Hi @petermbauer,

the C/C++/Objective-C analyzer was completely rewritten improving accuracy and returning better results.


(Petermbauer) #5

thanks for caring, i will check again with the new Version


(Petermbauer) #6

hi @mpaladin,

i re-checked with SonarCFamily 6.1: the L382 false-positive has been fixed but the L69 is still reported.


(Massimo Paladin) #7

Hi @petermbauer,

due to integer promotion >> type is signed, making ^ left operand of signed type.


(Petermbauer) #8

true, thank you!