This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: va_arg regression from 2.95.2 to 3.1


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]