Patchwork [testsuite] Add -fno-short-enums in gcc.dg/Wcxx-compat-12.c

login
register
mail settings
Submitter Jie Zhang
Date Sept. 28, 2010, 2:51 a.m.
Message ID <4CA1583F.1080402@codesourcery.com>
Download mbox | patch
Permalink /patch/65932/
State New
Headers show

Comments

Jie Zhang - Sept. 28, 2010, 2:51 a.m.
Some targets, like some ARM targets, default to -fshort-enums. For such 
targets, GCC doesn't report expected warnings for 
gcc.dg/Wcxx-compat-12.c. Instead it reports:

gcc.dg/Wcxx-compat-12.c:7:19: warning: initialization from incompatible 
pointer type
gcc.dg/Wcxx-compat-12.c:10:23: warning: initialization from incompatible 
pointer type

Adding -fno-short-enums in gcc.dg/Wcxx-compat-12.c would silence these 
warnings and make it test what intended.

OK?
Mark Mitchell - Sept. 28, 2010, 2:47 p.m.
On 9/27/2010 7:51 PM, Jie Zhang wrote:

> Adding -fno-short-enums in gcc.dg/Wcxx-compat-12.c would silence these
> warnings and make it test what intended.

OK.
Jie Zhang - Sept. 28, 2010, 3:10 p.m.
On 09/28/2010 10:47 PM, Mark Mitchell wrote:
> On 9/27/2010 7:51 PM, Jie Zhang wrote:
>
>> Adding -fno-short-enums in gcc.dg/Wcxx-compat-12.c would silence these
>> warnings and make it test what intended.
>
> OK.
>
Committed on trunk. Thanks.

Patch


	* gcc.dg/Wcxx-compat-12.c: Add -fno-short-enums.

Index: gcc.dg/Wcxx-compat-12.c
===================================================================
--- gcc.dg/Wcxx-compat-12.c	(revision 164675)
+++ gcc.dg/Wcxx-compat-12.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Wc++-compat" } */
+/* { dg-options "-fno-short-enums -Wc++-compat" } */
 
 enum E { A };