Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 1995 05:59:48 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        hackers@freebsd.org, hoppy@appsmiths.com
Subject:   Re: varargs.h / stdargs.h trouble
Message-ID:  <199506271959.FAA21846@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>It seems that varargs.h and stdargs.h in the distribution do not permit
>vararg handling for anything smaller than an int.  The macros simply call
>abort, which is not the desired behavior.

FreeBSD-2.x has the macros from 4.4lite.  The behavior of va_start() in
<stdarg.h> is undefined if the type of the arg isn't compatible with the
type that results after the application of the default argument promotions
(ISO C Standard 7.8.1.1).  There is no standard for <varargs.h>.

>For now, I scarfed the ones that came with the gcc-2.6.2, and they work, but
>I'm wonding if some repair is needed to the ones in /usr/include/sys.

The <stdarg.h> in gcc-2.6.2 begins with a comment saying that
va_arg(..., short) is not valid.  I think older versions of gcc's <stdarg.h>
went to more trouble to make it work.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506271959.FAA21846>