This is the mail archive of the gcc-patches@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: Patch for g++.dg/warn/multiple-overflow-warn-3.C test failure


Since I haven't gotten any feedback on this testsuite change I am going
to declare it obvious and check it in.

Steve Ellcey
sje@cup.hp.com

Copy of the original mail:

I don't know if this change is considered obvious or not.  This test
fails on HP-UX platforms because wchar_t is an unsigned int (not signed
like on Linux) and thus the test generates no overflow and no overflow
warnings on HP-UX.  Andrew Pinski suggested using 'short int' instead of
wchar_t.  This is what gcc.dg/multiple-overflow-warn-3.c already does
and that is what this patch implements.

OK for checkin?

Tested on HP-UX IA64 and PA, and on IA64 Linux with no failures.

Steve Ellcey
sje@cup.hp.com

2007-04-27  Steve Ellcey  <sje@cup.hp.com>

	* g++.dg/warn/multiple-overflow-warn-3.C: Change wchar_t to short.


Index: g++.dg/warn/multiple-overflow-warn-3.C
===================================================================
--- g++.dg/warn/multiple-overflow-warn-3.C	(revision 124207)
+++ g++.dg/warn/multiple-overflow-warn-3.C	(working copy)
@@ -2,10 +2,10 @@
 /* { dg-do compile } */
 /* { dg-options "-Woverflow" } */
 
-wchar_t
+short int
 g (void)
 {
-  wchar_t wc = ((wchar_t)1 << 31) - 1; /* { dg-bogus "overflow .* overflow" } */
+  short int wc = ((short int)1 << 31) - 1; /* { dg-bogus "overflow .* overflow" } */
   /* { dg-warning "overflow" "" { target *-*-* } 8 } */
   return wc;
 }


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