Subject: Re: Fixing va_arg in third party code
To: Joerg Sonnenberger <>
From: Hubert Feyrer <>
List: tech-pkg
Date: 10/04/2005 21:44:30
On Tue, 4 Oct 2005, Joerg Sonnenberger wrote:
> I've stumbled over some cases of incorrect va_arg use with small types.
> The problem is that e.g. "short" or "mode_t" (== uint16_t) arguments are
> promoted to int on all 32bit platforms (at least all I know about), but
> va_arg doesn't have to follow the same rules. In fact GCC 3.4's builtin
> va_arg support doesn't do it, but bitches about it instead.
> This results in two questions for me:
> (a) Do we want to fix it by chancing the va_arg usage unconditionally to int?
> I would do it for DragonFly otherwise, since I know it is correct on
> that platform.
> (b) Do we have any platform targeted by pkgsrc, which doesn't promote
> arguments shorter than int to that?

I'm under the impression that this is a bit outside the scope of pkgsrc, 
and that the changes should be put (eventually) into the programs itself, 
so their maintainers learn what good c0ding is.

  - Hubert