[OpenAFS-devel] Re: OpenAFS CVS Commit: openafs/src/util by shadow

Derrick J Brashear shadow@dementia.org
Tue, 1 Jul 2003 19:29:19 -0400 (EDT)


You read openafs-cvs? How perverse. I was going to post here and ask, but
since you answered, good enough.

On Tue, 1 Jul 2003, Russ Allbery wrote:

> cvs <cvs@GRAND.CENTRAL.ORG> writes:
>
> > this probably needs a better fix. however, one some platforms, we see:
> > ./snprintf.c: In function `afs_vsnprintf':
> > ./snprintf.c:227: `short int' is promoted to `int' when passed through `...'
> > ./snprintf.c:227: (so you should pass `int' not `short int' to `va_arg')
>
> > and it won't compile. are there platforms where short is correct?
>
> No.  C always promotes short to int when passing through ..., so you
> should always pass int to va_arg and then cast the result to short when
> assigning it (or just assign it to a short variable, which will cast it
> automatically).