stdc_memreverse8 with a size of zeroAuthors: Jay Ghiron
Date: 2026-11-04
Submitted against: C2Y (N3998 draft)
Status: Open
The proposal N3367 added the following function:
#include <stdbit.h> #include <limits.h> #if CHAR_BIT == 8 void stdc_memreverse8(size_t n, unsigned char ptr[static n]); #endif
(N3998 7.18.19 "8-bit Memory Reversal" paragraph 1.)
Does specifying n as an array length expression forbid it from being
zero? If the proposal
N3989 is
accepted then the answer would be clear.
If n being zero is valid, should ptr be allowed to be null when
n is zero? The proposal
N3322
allowed null pointers for many functions taking a size and a pointer,
but it could not have considered this function.