Skip to content

Handle misplaced _Checked modifier for array member or variable. #489

@dtarditi

Description

@dtarditi

It's possible to place a _Checked modifier on a declarator and have it be ignored:

// Spot check bounds for a flexible array member.
struct S5 {
  int len;
  int _Checked arr[] : count(len);
};

A programmer likely meant:

// Spot check bounds for a flexible array member.
struct S5 {
  int len;
  int arr _Checked[] : count(len);
};

We should only allow _Checked on function declarators or check that the modified type is indeed a valid checked type (for example a checked array).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions