This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
RE: c/4152: Incorrect code for va_arg(x,char) and va_arg(x,short) on SH
- To: "'sirl at gcc dot gnu dot org'" <sirl at gcc dot gnu dot org>
- Subject: RE: c/4152: Incorrect code for va_arg(x,char) and va_arg(x,short) on SH
- From: "Schirmer, Hartmut" <SchirmerH at Innovative-Systems dot de>
- Date: Tue, 28 Aug 2001 15:19:25 +0200
- Cc: gcc-bugs at gcc dot gnu dot org
> -----Original Message-----
> From: sirl@gcc.gnu.org [mailto:sirl@gcc.gnu.org]
> Sent: Tuesday, August 28, 2001 10:12 AM
> To: SchirmerH@innovative-systems.de; gcc-bugs@gcc.gnu.org;
> gcc-prs@gcc.gnu.org; nobody@gcc.gnu.org
> Subject: Re: c/4152: Incorrect code for va_arg(x,char) and
> va_arg(x,short) on SH
>
>
> Synopsis: Incorrect code for va_arg(x,char) and va_arg(x,short) on SH
>
> State-Changed-From-To: open->closed
> State-Changed-By: sirl
> State-Changed-When: Tue Aug 28 01:12:22 2001
> State-Changed-Why:
> The C code is invalid (thus the warning), please resubmit
> (if the problem persists) with valid C, eg.
>
> value = (char) va_arg (m, int);
>
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4152&database=gcc
>
Thanks for your analysis.
What does 'invalid' mean in this case ?
Not covered by C89, not by C99 or not
covered by GNU-C ?
The provided code works just fine using
gcc 2.95 (x86 & SH) but fails with an
exception when compiled with gcc 3.0.1 on
SH target.
If it's invalid in a way GCC can generate a null
pointer access there should be an error, not a
warning.
I tried all combinations and only thoese with
sizeof(type) < sizeof(int) failed.
I still think gcc is wrong here. It used to
work right and still could work right.
The new warning is good.
Hartmut