Commit a3bf324c by Richard Henderson Committed by Richard Henderson

c-decl.c (check_bitfield_type_and_width): Remove enum special case suppression of pedwarn.

        * c-decl.c (check_bitfield_type_and_width): Remove enum special
        case suppression of pedwarn.
        * system.h (ENUM_BITFIELD): Use __extension__.
        (CHAR_BITFIELD): Likewise.
cp/
        * cp-tree.h (struct lang_type_header): Remove __extension__.
testsuite/
        * gcc.dg/bitfld-1.c: Expect warnings for enum bitfields.

From-SVN: r74797
parent 28e4696c
2003-12-18 Richard Henderson <rth@redhat.com>
* c-decl.c (check_bitfield_type_and_width): Remove enum special
case suppression of pedwarn.
* system.h (ENUM_BITFIELD): Use __extension__.
(CHAR_BITFIELD): Likewise.
2003-12-18 Ulrich Weigand <uweigand@de.ibm.com>
Mark Dettinger <dettinge@de.ibm.com>
......
......@@ -3268,10 +3268,7 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name)
if (pedantic
&& type_mv != integer_type_node
&& type_mv != unsigned_type_node
&& type_mv != boolean_type_node
/* Accept an enum that's equivalent to int or unsigned int. */
&& (TREE_CODE (*type) != ENUMERAL_TYPE
|| TYPE_PRECISION (*type) != TYPE_PRECISION (integer_type_node)))
&& type_mv != boolean_type_node)
pedwarn ("type of bit-field `%s' is a GCC extension", name);
if (type_mv == boolean_type_node)
......
2003-12-18 Richard Henderson <rth@redhat.com>
* cp-tree.h (struct lang_type_header): Remove __extension__.
2003-12-18 Jason Merrill <jason@redhat.com>
PR c++/12253
......
......@@ -1017,7 +1017,7 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* This is a few header flags for 'struct lang_type'. Actually,
all but the first are used only for lang_type_class; they
are put in this structure to save space. */
__extension__ struct lang_type_header GTY(())
struct lang_type_header GTY(())
{
CHAR_BITFIELD is_lang_type_class : 1;
......
......@@ -490,8 +490,8 @@ extern int snprintf (char *, size_t, const char *, ...);
FIXME: provide a complete autoconf test for buggy enum bitfields. */
#if (GCC_VERSION > 2000)
#define ENUM_BITFIELD(TYPE) enum TYPE
#define CHAR_BITFIELD unsigned char
#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
#define CHAR_BITFIELD __extension__ unsigned char
#else
#define ENUM_BITFIELD(TYPE) unsigned int
#define CHAR_BITFIELD unsigned int
......
2003-12-18 Richard Henderson <rth@redhat.com>
* gcc.dg/bitfld-1.c: Expect warnings for enum bitfields.
2003-12-18 Steven Bosscher <steven@gcc.gnu.org>
Dan Kegel <dank@kegel.com>
......
......@@ -25,6 +25,7 @@ struct bf1
unsigned long g: 5; /* { dg-warning "GCC extension|ISO C" } */
ui h: 5;
enum foo i: 2; /* { dg-error "narrower" } */
enum foo j: 3;
/* { dg-warning "GCC extension|ISO C" "extension" { target *-*-* } 27 } */
enum foo j: 3; /* { dg-warning "GCC extension|ISO C" } */
unsigned int k: 256; /* { dg-error "exceeds its type" } */
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment