Hello,

Test case g++.dg/torture/20141013.C (added https://gcc.gnu.org/ml/gcc-patches/2014-10/msg01190.html) triggers the warning
--
  20141013.C:45:23: warning: width of 'tree_base::code' exceeds its type
--
on arm-none-eabi.

The code specifies a bitfield of size 16 with an enum as the underlying type. On arm-none-eabi, enums are packed by default (-fshort-enums) so the bitfield is oversized and the warning is correct.

This patch adds -fno-short-enums to the compiler options for the test case.

Testing: Ran g++.dg/torture/dg-torture.exp for arm-none-eabi and arm-none-linux-gnueabihf.

Matthew

2015-01-13  Matthew Wahab  <matthew.wa...@arm.com>

        * testsuite/g++.dg/torture/20141013.C: Set -fno-short-enums.
diff --git a/gcc/testsuite/g++.dg/torture/20141013.C b/gcc/testsuite/g++.dg/torture/20141013.C
index 529ef0965e4472e5038a9e6d09f13ca4f4a05954..82aacd6317eb3cd66b2839347a708ae0f4787efc 100644
--- a/gcc/testsuite/g++.dg/torture/20141013.C
+++ b/gcc/testsuite/g++.dg/torture/20141013.C
@@ -1,3 +1,4 @@
+/* { dg-options "-fno-short-enums" } */
 enum
 {
   _sch_isdigit = 0x0004,

Reply via email to