Skip to content

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

Closed
@lcartey

Description

@lcartey

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

Metadata

Metadata

Assignees

Labels

Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-MediumStandard-MISRA-Cfalse positive/false negativeAn issue related to observed false positives or false negatives.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions