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 10:43:34PM +0200, Joerg Sonnenberger wrote:
> On Thu, Jul 14, 2011 at 10:24:57PM +0200, Klaus Klein wrote:
> > 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.
> 
> I guess C89 wanted to play with the varargs.h mess. The question is --
> do we care about this?

Why make life for strictly conforming C99 code harder than necessary by
defining va_list?  (Or wrt. the C89 rationale, s/conforming/legacy/ and
s/\(va_list\)/a particular \1/ :-).

Nowadays it's reduced to a name space consideration, but I'm with David
on that one.

> > 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.
> 
> Adjusted.

Thanks!


- Klaus


Home | Main Index | Thread Index | Old Index