FPU Bounds [Was: Re: openssh4.0 upgrade]

Joerg Sonnenberger joerg at britannica.bec.de
Wed Mar 23 11:10:29 PST 2005


On Wed, Mar 23, 2005 at 11:01:09AM -0800, Matthew Dillon wrote:
> :../../bus/ppbus/ppb_msq.c: In function `ppb_MS_init_msq':
> :../../bus/ppbus/ppb_msq.c:222: warning: `char' is promoted to `int' when passed through `...'
> :../../bus/ppbus/ppb_msq.c:222: warning: (so you should pass `int' not `char' to `va_arg')
> :../../bus/ppbus/ppb_msq.c:222: note: if this code is reached, the program will abort
> :
> :Joerg
> 
>     Joerg, could you add a patch to the gcc-3 build to turn that warning
>     into a compile-time error?

Sure.

>     I consider this a bug in gcc.  When the varargs functions were originally
>     created they were documented as properly dealing with internal compiler
>     argument promotions... and they did.  Apparently, now, they don't,
>     and some half-brain decided it should be a warning rather then the
>     terminal error that it really ought to be.

Well, the wording of SUS ("If there is no actual next argument, or if type
is not compatible with the type of the actual next argument (as promoted
according to the default argument promotions), the behaviour is undefined,
. ..") allows the behaviour of GCC. I think this might actually be a difference
between the old varargs.h and stdarg.h.

Joerg





More information about the Submit mailing list