Handling argc==0 in the kernel
Handling argc==0 in the kernel
Posted Jan 31, 2022 10:02 UTC (Mon) by larkey (guest, #104463)In reply to: Handling argc==0 in the kernel by NYKevin
Parent article: Handling argc==0 in the kernel
Fair enough, although I *think* C restricts the meaning of array to things that are declared T D[N]; Zero-allocations are definitely possible though, yes, and POSIX is a bit more lax about wording since they say "argv is an array" while, in C terminology, it's "just" a pointer to some memory that... and so on.
Anyway, the POSIX standard pretty clearly says that argv is NULL-terminated, that is, not by itself a zero-length array, but at least
char **argv = { NULL };
