This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc.dg/cpp/charconst.c vs. WCHAR_TYPE "long int"
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 22 Mar 2002 23:42:23 +0000
- Subject: Re: gcc.dg/cpp/charconst.c vs. WCHAR_TYPE "long int"
- References: <5.1.0.14.2.20020322132948.040760b0@mail.lauterbach.com>
Franz Sirl wrote:-
> Hi,
>
> the testcase gcc.dg/cpp/charconst.c fails on powerpc-linux-gnu because of
> an extra warning on this line:
>
> c = L'very long'; /* { dg-warning "too long" "long wide charconst" }
> */
>
> /home/fsirl/cvsx/gcc31/gcc/testsuite/gcc.dg/cpp/charconst.c: In function
> `foo':
> /home/fsirl/cvsx/gcc31/gcc/testsuite/gcc.dg/cpp/charconst.c:28: warning:
> overflow in implicit constant conversion
>
> An additional (int) cast silences this extra warning, is this the right
> thing to do?
This appears to be a bug in force_fit_type(), so I don't wish to
change the testcase to accommodate it. Run the following in gdb
with a breakpoint on lex_charconst, when it stops, put a breakpoint
on force_fit_type, and run it to that breakpoint. Watch the function
mangle the charconst. With my cross compiler it goes in as 506806141029
and comes out as 101 with overflow; it should be unchanged IMO.
void foo () {
int c;
c = L'very long';
}
If I'm right, I find it scary that these number bugs in GCC are so common
and so persistent.
Neil.