FPU Bounds [Was: Re: openssh4.0 upgrade]
dillon at apollo.backplane.com
Wed Mar 23 11:02:31 PST 2005
:On Wed, Mar 23, 2005 at 05:07:54PM +0100, Joerg Sonnenberger wrote:
:> On Wed, Mar 23, 2005 at 01:52:24AM -0800, Matthew Dillon wrote:
:> > In anycase, it looks like GCC just breaks when you use the internal
:> > va_arg with a 'char' type. It is supposed to promote the argument
:> > to an int and then cast it to a char. Instead it generates, well,
:> > what you see.
:> Actually this is a bug in the code using va_arg. There is even a warning
:> flag for GCC to catch implicit int promotions for variadic functions,
:> because the variadic function has to use int.
:And the flag is on, the compiler does warn about this. One more reason to get
:our kernel -Werror ready :)
:../../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, could you add a patch to the gcc-3 build to turn that warning
into a compile-time error?
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.
<dillon at xxxxxxxxxxxxx>
More information about the Submit