This is the mail archive of the gcc@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: gcc.dg/cpp/charconst.c vs. WCHAR_TYPE "long int"


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.


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