Declaring an array of negative length

It’s undefined behaviour, because it breaks a “shall” constraint:

C99 ยง6.7.5.2:

If the size is an expression that is
not an integer constant expression…
…each time it is evaluated it shall
have a value greater than zero.

Leave a Comment