Skip to content

An nt_checked array with an empty initializer list should be an error #1119

@secure-sw-dev-bot

Description

@secure-sw-dev-bot

This issue was copied from checkedc/checkedc-clang#1120


Consider the following declaration of an nt_checked array:
char p nt_checked[] = {}

According to the Checked C spec section 2.4:

  1. nt_checked declares an array whose last element is a null terminator. The size of the array includes the null terminator element.
  2. An nt_checked array with size d converts to an nt_array_ptr with a count of d - 1 elements.

So it should be illegal to declare an nt_checked array with an empty initializer list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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