On Apr 15 09:34, Yaakov Selkowitz wrote:
On 2016-04-15 06:22, Corinna Vinschen wrote:
On Apr 15 12:52, Sebastian Huber wrote:
On 15/04/16 12:11, Corinna Vinschen wrote:
On Apr 14 13:54, Sebastian Huber wrote:
Add __va_list to <sys/_types.h> for BSD compatibility. In FreeBSD this
typedef is provided by the various architecture-specific
<machine/_types.h> in a copy and paste manner.
Is that supposed to replace __VALIST in stdio.h>
No, it is used to use, e.g. <syslog.h> from FreeBSD (see tail of file):
I'm asking because FreeBSD uses __va_list throughout stdio.h rather than
using this weird __VALIST. I think we should do the same (not in this
patch series, but again, something to keep in mind).
I also just noticed that stdio.h always includes stddef.h to fetch the
definition of va_list. This seems wrong in terms of the feature test
macros. FreeBSD only defines va_list (as __va_list) if
__POSIX_VISIBLE >= 200112 || __XSI_VISIBLE.
Since you said va_list, I'm guessing you meant <stdarg.h> here.
Duh, right.
Looking at
each version of stdio.h in SUS though, va_list is marked XSI until SUSv4
where it is CX, so I think it should be __POSIX_VISIBLE >= 200809 ||
__XSI_VISIBLE.
Sounds good to me and matches glibc's stdio.h. Do you want to create a
patch? As a sidenote, glibc's stdio.h only includes stdarg.h with
non-gcc compilers. Otherwise it typedef's va_list directly as
_G_va_list aka __gnuc_va_list, just as our stdio.h does with __VALIST.