Re: [hackers] [sbase][PATCH] cp: add -i flag
Hi,
On Wed, Apr 23, 2025 at 01:08:00PM +0200, THIBAUT AUBIN wrote:
> Regarding <stdarg.h> in "util.h", this was omitted in accordance to ISO/IEC
> 9899:1999 (C99) §7.19.6.8.
> A conforming C library must provide the v-printf family (e.g: `vfprintf`,
> `vprintf`, `vsprintf`, `vsnprintf` in <stdio.h>, so on most platforms
> <stdio.h> ends up including <stdarg.h> (or otherwise `va_list`).
There are two different things. One is providing the function definition
and other is the va_arg type definition. In fact, The C standard explicitely
forbids including one standard header in other header, and it explicitely
what every header exposes. For example, in musl (and something similar in scc):
int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list);
because stdio.h cannot expose va_list, but it has to expose vfprintf
(for example to use it as a function pointer).
Regards,
Received on Wed Apr 23 2025 - 14:18:10 CEST
This archive was generated by hypermail 2.3.0
: Wed Apr 23 2025 - 14:24:42 CEST