3 ms·
you can however use void foo(char data[static 0], int len) with 0 or 1 to signal at least zero/one elements are required (for example), and the pointer mu
by kzrdude 8y ago
you can however use
void foo(char data[static 0], int len)
with 0 or 1 to signal at least zero/one elements are required (for example), and the pointer must be non-null.
- kbp 8y agoThe standard says "If the expression is a constant expression, it shall have a value greater than zero." Clang gives me a warning that "static 0" has no effect. NULL is valid as a pointer to a 0-length array, so that makes sense that it wouldn't function as a non-NULL assertion.