diff options
author | obrien <obrien@FreeBSD.org> | 2005-09-07 18:15:08 +0800 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2005-09-07 18:15:08 +0800 |
commit | d78b6f0fb480c12d712de2eb847dfb807e584c2a (patch) | |
tree | c82e9a896e8c0685b2976d4466892ece642b95fd | |
parent | e577b14dd9b45a4fc0b3f59eb77f311b9df15224 (diff) | |
download | freebsd-ports-gnome-d78b6f0fb480c12d712de2eb847dfb807e584c2a.tar.gz freebsd-ports-gnome-d78b6f0fb480c12d712de2eb847dfb807e584c2a.tar.zst freebsd-ports-gnome-d78b6f0fb480c12d712de2eb847dfb807e584c2a.zip |
Fix bug where static forward declarations weren't accepted.
This allows us to fix non-ISO-C constructs in our kernel to legal ISO-C.
Submitted by: rodrigc
Obtained from: http://gcc.gnu.org/ml/gcc-patches/2005-09/msg00006.html
-rw-r--r-- | lang/gcc/files/patch-c-decl.c | 16 | ||||
-rw-r--r-- | lang/gcc34/files/patch-c-decl.c | 16 | ||||
-rw-r--r-- | lang/gcc41/files/patch-c-decl.c | 16 | ||||
-rw-r--r-- | lang/gcc42/files/patch-c-decl.c | 16 | ||||
-rw-r--r-- | lang/gcc43/files/patch-c-decl.c | 16 | ||||
-rw-r--r-- | lang/gcc44/files/patch-c-decl.c | 16 | ||||
-rw-r--r-- | lang/gcc45/files/patch-c-decl.c | 16 | ||||
-rw-r--r-- | lang/gcc46/files/patch-c-decl.c | 16 | ||||
-rw-r--r-- | lang/gcc47/files/patch-c-decl.c | 16 | ||||
-rw-r--r-- | lang/gcc48/files/patch-c-decl.c | 16 |
10 files changed, 160 insertions, 0 deletions
diff --git a/lang/gcc/files/patch-c-decl.c b/lang/gcc/files/patch-c-decl.c new file mode 100644 index 000000000000..620989f79100 --- /dev/null +++ b/lang/gcc/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Wed Aug 17 17:21:28 2005 ++++ gcc/c-decl.c Wed Sep 7 02:18:44 2005 +@@ -1555,7 +1555,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); diff --git a/lang/gcc34/files/patch-c-decl.c b/lang/gcc34/files/patch-c-decl.c new file mode 100644 index 000000000000..cf7e46182736 --- /dev/null +++ b/lang/gcc34/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Mon Aug 8 00:42:26 2005 ++++ gcc/c-decl.c Wed Sep 7 02:41:09 2005 +@@ -1271,7 +1271,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning ("%Jredundant redeclaration of '%D'", newdecl, newdecl); + warned = true; diff --git a/lang/gcc41/files/patch-c-decl.c b/lang/gcc41/files/patch-c-decl.c new file mode 100644 index 000000000000..620989f79100 --- /dev/null +++ b/lang/gcc41/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Wed Aug 17 17:21:28 2005 ++++ gcc/c-decl.c Wed Sep 7 02:18:44 2005 +@@ -1555,7 +1555,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); diff --git a/lang/gcc42/files/patch-c-decl.c b/lang/gcc42/files/patch-c-decl.c new file mode 100644 index 000000000000..620989f79100 --- /dev/null +++ b/lang/gcc42/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Wed Aug 17 17:21:28 2005 ++++ gcc/c-decl.c Wed Sep 7 02:18:44 2005 +@@ -1555,7 +1555,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); diff --git a/lang/gcc43/files/patch-c-decl.c b/lang/gcc43/files/patch-c-decl.c new file mode 100644 index 000000000000..620989f79100 --- /dev/null +++ b/lang/gcc43/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Wed Aug 17 17:21:28 2005 ++++ gcc/c-decl.c Wed Sep 7 02:18:44 2005 +@@ -1555,7 +1555,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); diff --git a/lang/gcc44/files/patch-c-decl.c b/lang/gcc44/files/patch-c-decl.c new file mode 100644 index 000000000000..620989f79100 --- /dev/null +++ b/lang/gcc44/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Wed Aug 17 17:21:28 2005 ++++ gcc/c-decl.c Wed Sep 7 02:18:44 2005 +@@ -1555,7 +1555,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); diff --git a/lang/gcc45/files/patch-c-decl.c b/lang/gcc45/files/patch-c-decl.c new file mode 100644 index 000000000000..620989f79100 --- /dev/null +++ b/lang/gcc45/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Wed Aug 17 17:21:28 2005 ++++ gcc/c-decl.c Wed Sep 7 02:18:44 2005 +@@ -1555,7 +1555,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); diff --git a/lang/gcc46/files/patch-c-decl.c b/lang/gcc46/files/patch-c-decl.c new file mode 100644 index 000000000000..620989f79100 --- /dev/null +++ b/lang/gcc46/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Wed Aug 17 17:21:28 2005 ++++ gcc/c-decl.c Wed Sep 7 02:18:44 2005 +@@ -1555,7 +1555,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); diff --git a/lang/gcc47/files/patch-c-decl.c b/lang/gcc47/files/patch-c-decl.c new file mode 100644 index 000000000000..620989f79100 --- /dev/null +++ b/lang/gcc47/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Wed Aug 17 17:21:28 2005 ++++ gcc/c-decl.c Wed Sep 7 02:18:44 2005 +@@ -1555,7 +1555,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); diff --git a/lang/gcc48/files/patch-c-decl.c b/lang/gcc48/files/patch-c-decl.c new file mode 100644 index 000000000000..620989f79100 --- /dev/null +++ b/lang/gcc48/files/patch-c-decl.c @@ -0,0 +1,16 @@ +$FreeBSD$ + +--- gcc/c-decl.c.orig Wed Aug 17 17:21:28 2005 ++++ gcc/c-decl.c Wed Sep 7 02:18:44 2005 +@@ -1555,7 +1555,10 @@ diagnose_mismatched_decls (tree newdecl, + && !(DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl)) + /* Don't warn about forward parameter decls. */ + && !(TREE_CODE (newdecl) == PARM_DECL +- && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl))) ++ && TREE_ASM_WRITTEN (olddecl) && !TREE_ASM_WRITTEN (newdecl)) ++ /* Don't warn about a variable definition following a declaration. */ ++ && !(TREE_CODE (newdecl) == VAR_DECL ++ && DECL_INITIAL (newdecl) && !DECL_INITIAL (olddecl))) + { + warning (OPT_Wredundant_decls, "redundant redeclaration of %q+D", + newdecl); |