va_arg regression from 2.95.2 to 3.1
Nathan Sidwell
nathan@codesourcery.com
Wed Mar 27 11:16:00 GMT 2002
"Joseph S. Myers" wrote:
> I think the argument is correct, and that this call to va_arg should be
> considered the same as a call where the types turn out to be incompatible
> at runtime (except here, the runtime type cannot be compatible). It ought
> to be a mandatory warning (not pedwarn, not error); and should either be
> compiled into a call to abort() or be treated as a call to va_arg with the
> promoted type followed by conversion to the type specified.
I agree. IMO it is the same as something like
if (c >= BITS_PER_INT)
v = 0;
else
v = v >> c;
if 'c' is a constant, we'll warn on the 'v >> c', even though
control will never pass through there. We should handle the varargs
case in a similar manner
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
More information about the Gcc-bugs
mailing list