va_arg regression from 2.95.2 to 3.1

Joseph S. Myers jsm28@cam.ac.uk
Wed Mar 27 07:07:00 GMT 2002


On Wed, 27 Mar 2002, Richard Henderson wrote:

> On Wed, Mar 27, 2002 at 09:25:44AM +0100, Schirmer, Hartmut wrote:
> > Since
> >         res = va_arg(ap,int16);
> > will never be executed the compiler shouldn't give an error.
> 
> Possibly.  I'm unconvinced.

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.

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc-bugs mailing list