-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MISRA C++ 2023 rule 7.0.5 "Integral promotion or the usual arithmetic conversions shall not change the type signedness" #605
Comments
MISRACPP2023-7_0_5-a_Warning_ZserioRuntime.xlsx |
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 |
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. |
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: 4d22803
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.
The text was updated successfully, but these errors were encountered: