This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: va_arg regression from 2.95.2 to 3.1
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Richard Henderson <rth at redhat dot com>
- Cc: "Schirmer, Hartmut" <HSchirmer at Innovative-Systems dot de>, "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Date: Wed, 27 Mar 2002 13:28:14 +0000 (GMT)
- Subject: 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