Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

RULE-10-4: Incorrect essential types identified #747

Copy link
Copy link
Closed
@lcartey

Description

@lcartey
Issue body actions

Affected rules

  • RULE-10-4

Description

This rule has a number of issues related to how essential types are resolved:

  • The essential type of an enum type is not considered after resolving typedefs and removing specifiers.
  • The essential type of an anonymous enum (as specified by MISRA) is not considered to be essentially signed.
  • \n is not considered to be char type.

Example

void example_function(char c, int i) {
  typedef enum { A } EA;
  EA ea = A;
  ea == A; // COMPLIANT[FALSE_POSITIVE]
  c == `\n`; // COMPLIANT[FALSE_POSITIVE]
  enum { B };
  i == B; // COMPLIANT[FALSE_POSITIVE]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-Mediumfalse positive/false negativeAn issue related to observed false positives or false negatives.An issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding StandardsIssue reported by an end user of CodeQL Coding Standards

    Type

    No type

    Projects

    Status

    Done
    Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.