DragonFly BSD
DragonFly submit List (threaded) for 2005-03
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxx>
Date: Wed, 23 Mar 2005 20:06:39 +0100
Mail-followup-to: submit@crater.dragonflybsd.org

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



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]