Skip to content
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

Unary minus operator should not be applied to an unsigned expression #2150

Closed
ArielSAdamsNASA opened this issue Sep 23, 2022 · 0 comments · Fixed by #2437
Closed

Unary minus operator should not be applied to an unsigned expression #2150

ArielSAdamsNASA opened this issue Sep 23, 2022 · 0 comments · Fixed by #2437

Comments

@ArielSAdamsNASA
Copy link

Describe the bug
Negation of unsigned value

Expected behavior
Keep same behavior but fix CodeQL warning.

Code snips

const int32 LOWER_THRESHOLD = -CFE_EVS_Global.EVS_EventBurstMax * 1000;

Additional context
Caught by CodeQL - Violation of MISRA (Part of the coding standard). Could cast EVS_EventBurstMax.

Reporter Info
Ariel Adams, MCSG Tech

dzbaker added a commit that referenced this issue Sep 13, 2023
Fix #2150, Adds a cast to the negation of unsigned expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants