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 06:32:35PM +0000, David Holland wrote:
> On Tue, Jul 12, 2011 at 06:55:57PM +0200, Joerg Sonnenberger wrote:
>  > - Drop varargs.h support. Pre-ANSI support is pretty pointless nowadays
>  >   and it hasn't been supported by modern compilers for a long time.
>  > 
>  > - Merge all the MD stdarg.h implementations into sys/stdarg.h.
>  >   There are two major cases here:
>  >   - lint, which is stupid and gets some fake implementation of the
>  >   builtins.
>  >   - Real compiler, which are supposed to provide the GCC 4.5 builtins.
>  >     Compiler not visible as GCC 4.5 map __builtin_va_start to
>  >     __builtin_stdarg_start.
> 
> This and the rest should be separate packages, don't you think?

Not really, they depend on each other.

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

Joerg


Home | Main Index | Thread Index | Old Index