Closed mohammedRafeeque closed 1 month ago
MISRACPP2023-7_0_5-a_Warning_ZserioRuntime.xlsx Warnings report attached.
Probably SonarCloud rule "Signed and unsigned types should not be mixed in expressions" could be used for this. We will investigate it during the current milestone.
@mohammedRafeeque, we have tried to use the SonarCloud rule "Signed and unsigned types should not be mixed in expressions". Unfortunatelly, this rule does not catch anything from given xlsx sheet. So, we should discuss how to continue with the rule which we are not able to reproduce.
Besides of that, please check the attached xlsx. For example, there is a finding in FloatUtil.cpp
, line 158 (2 times). However, this line is a comment. Please check it here.
You are right in FloatUtil.cpp and BitStreamWriter.cpp there is a auto formating done in local version. So there is a change in line number to mentioned tag version.
Line 158 refers to source code line below
const uint16_t exponent16Shifted = static_cast
zserio_modifiedfiles_FileUtil_and_BitStreamWriter.zip
Refer the attached zip file for locally modified version of two files FloatUtil.cpp and BitStreamWriter.cpp
Unfortunately, the corresponding SonarCloud rule did not catch anything (clang-tidy and compiler warnings did not catch anything as well). We are not able to reproduce it and we are not going to fix it blindly.
Enabled also Sonar Rule cpp:S5276 - Implicit casts should not lower precision, nothing caught.
Zserio version and language Zserio: master branch Commit hash: 4d228036f4cb51199e151292968c8ecacc4924ce Language: C++ Priority : 1
Describe the bug Check and resolve SCA warning MISRACPP2023-7_0_5-a Integral promotion or the usual arithmetic conversions shall not change the type signedness of an operand from 'uint16_t' to 'int'
How to reproduce Steps to reproduce the behavior: SCA run usinf MISRA 2023 configuration. See the attached excel for 251 warnings details and location reference.
Expected behavior No SCA warnings for MISRA 2023 ruleset
Additional context N.A
@Roland-Homeier @mikir FYI.