Skip to content

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

@mgrang

Description

@mgrang

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

Labels

bugThis labels issues that are bugs.

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