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

RULE-10-3: Essential type of binary bitwise operations is incorrect #786

Open
lcartey opened this issue Oct 28, 2024 · 0 comments · May be fixed by #787
Open

RULE-10-3: Essential type of binary bitwise operations is incorrect #786

lcartey opened this issue Oct 28, 2024 · 0 comments · May be fixed by #787
Assignees
Labels
Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Standard-MISRA-C

Comments

@lcartey
Copy link
Collaborator

lcartey commented Oct 28, 2024

Affected rules

  • RULE-10-1
  • RULE-10-3
  • RULE-10-4
  • RULE-10-5
  • RULE-10-6
  • RULE-10-7
  • RULE-10-8
  • RULE-12-2

Description

The |, & and ^ binary bitwise operations are currently incorrectly assigned the standard type as the essential type of the expression. Instead, their treatment under essential types should be similar to other arithmetic expressions, in that if both operands are consistently signed, the essential type is the has the same signedness, and a rank of the larger of the two operands.

Example

uint8_t u8;
uint16_t u16;
u8 & u16; // Should have an essential type of unsigned short, not the standard type of int
@lcartey lcartey added Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium labels Oct 28, 2024
@lcartey lcartey self-assigned this Oct 28, 2024
@lcartey lcartey moved this from Reported to In Progress in Coding Standards Public Development Board Oct 28, 2024
@lcartey lcartey moved this from In Progress to Ready for review in Coding Standards Public Development Board Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Standard-MISRA-C
Projects
Status: Ready for review
2 participants