summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-08 06:48:21 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2007-03-08 06:48:21 +0000
commit78ba9fedc8faeb2657f8b39ea18cbd80ccdc35d3 (patch)
tree499aa3c7dffb31031e454f7b8479fd3655391c0f
parent636fad7abdcf5d830186700b7145265310eaaa28 (diff)
downloadppe42-gcc-78ba9fedc8faeb2657f8b39ea18cbd80ccdc35d3.tar.gz
ppe42-gcc-78ba9fedc8faeb2657f8b39ea18cbd80ccdc35d3.zip
gcc/ChangeLog:
* c-decl.c (grokdeclarator): Disable warnings for anonymous bitfields. * tree-sra.c (instantiate_element): Propagate disabled warnings from the element itself to the created variable. gcc/cp/ChangeLog: * decl.c (grokdeclarator): Disable warnings for anonymous bitfields. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122684 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/c-decl.c2
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c5
-rw-r--r--gcc/tree-sra.c2
5 files changed, 20 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b3b40ede191..21c0770da9a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * c-decl.c (grokdeclarator): Disable warnings for anonymous
+ bitfields.
+ * tree-sra.c (instantiate_element): Propagate disabled warnings
+ from the element itself to the created variable.
+
2007-03-07 Richard Henderson <rth@redhat.com>
PR target/30848
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index b2bed24afd8..0d9fce559e7 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -4748,6 +4748,8 @@ grokdeclarator (const struct c_declarator *declarator,
type = c_build_qualified_type (type, type_quals);
decl = build_decl (FIELD_DECL, declarator->u.id, type);
DECL_NONADDRESSABLE_P (decl) = bitfield;
+ if (bitfield && !declarator->u.id)
+ TREE_NO_WARNING (decl) = 1;
if (size_varies)
C_DECL_VARIABLE_SIZE (decl) = 1;
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 2db8d9cbb85..de0dfd425f1 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2007-03-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * decl.c (grokdeclarator): Disable warnings for anonymous
+ bitfields.
+
2007-03-05 Volker Reichelt <reichelt@netcologne.de>
* typeck2.c (readonly_error): Always emit a hard error.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 749cee33589..62c1aafef8e 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1,6 +1,6 @@
/* Process declarations and variables for C++ compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
@@ -8539,6 +8539,9 @@ grokdeclarator (const cp_declarator *declarator,
{
decl = build_decl (FIELD_DECL, unqualified_id, type);
DECL_NONADDRESSABLE_P (decl) = bitfield;
+ if (bitfield && !unqualified_id)
+ TREE_NO_WARNING (decl) = 1;
+
if (storage_class == sc_mutable)
{
DECL_MUTABLE_P (decl) = 1;
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index ef7707f8b0d..9cf2cef8aa7 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1241,6 +1241,8 @@ instantiate_element (struct sra_elt *elt)
DECL_IGNORED_P (var) = 0;
TREE_NO_WARNING (var) = TREE_NO_WARNING (base);
+ if (elt->element && TREE_NO_WARNING (elt->element))
+ TREE_NO_WARNING (var) = 1;
}
else
{
OpenPOWER on IntegriCloud