Skip to content

Rule 10.1 is wrong, uses exception of the standard as non compliant example #6

Description

@cscherrNT

MISRA-C (2012) lists the following exception for that rule:

A non-negative integer constant expression of essentially signed type may be used as the right hand operand to a shift operator.

However, this is exactly what this repository lists as a non compiant example.

#[allow(unused_variables)]

fn main() {
    let x: i32 = 0xFF;
    let y = x << 2;
    //~^ ERROR Non-compliant - inappropriate essential type
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions