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 19:38:59 +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?
I don't think so. If the warning is correct, then lets make the type a
long.
But first I'd like to understand why this is happening. What is the
type of wchar_t on your system and how many bytes is it? What about
int? I can only see this happening if your int is 16 bits and wchar_t
32, or 32 / 64 respectively.
Neil.