tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: MIfying stdarg.h and dropping varargs.h



On Thu, Jul 14, 2011 at 08:42:44PM +0200, Joerg Sonnenberger wrote:
> On Thu, Jul 14, 2011 at 06:32:35PM +0000, David Holland wrote:
> > On Tue, Jul 12, 2011 at 06:55:57PM +0200, Joerg Sonnenberger wrote:
> 
> >  > - Fix the _BSD_VA_LIST_ usage to actually define va_list in various
> >  >   places as required by POSIX.
> >  > 
> >  > - Include sys/stdarg.h from sys/systm.h, it's used enough to simplify
> >  >   the kernel sources that way.
> >  > 
> >  > - Stop abusing _BSD_VA_LIST_, just go with va_list directly, defining it
> >  >   as needed or including stdarg.h.
> > 
> > This breaks e.g. stdio.h, which is not allowed to define va_list.
> 
> POSIX explicitly requires it. C99 doesn't exactly make sense in this
> regard as it requires it for the prototypes, but also requires including
> stdarg.h first.

C89 went out of its way and made an attempt to play nice with existing
code.  POSIX-2008, as a particular profile of C99, doesn't need to.

On a related note, the change to <syslog.h> defines va_list but it shouldn't;
vsyslog() and friends aren't in POSIX, so at the very least the definition
should be moved to the _NETBSD_SOURCE section.


- Klaus


Home | Main Index | Thread Index | Old Index