diff options
author | uqs <uqs@FreeBSD.org> | 2011-07-01 20:45:55 +0000 |
---|---|---|
committer | uqs <uqs@FreeBSD.org> | 2011-07-01 20:45:55 +0000 |
commit | 0c741bc1eedb4d26949816ee5c5e94e69e189c86 (patch) | |
tree | 5bcbc7ecac1da7660759b0d92b44cffcc9e90817 /contrib/gcc | |
parent | 5f1c3c9af6f02974854d7b25f3cbc1c5954c1769 (diff) | |
download | FreeBSD-src-0c741bc1eedb4d26949816ee5c5e94e69e189c86.zip FreeBSD-src-0c741bc1eedb4d26949816ee5c5e94e69e189c86.tar.gz |
- Fix typo in check_for_nested_with_variably_modified present
- Implement -Wvariable-decl.
- Port -Wtrampolines support from gcc3.
(all three also via OpenBSD)
PR: gnu/127136, gnu/157019
Submitted by: Henning Petersen, Pedro Giffuni
MFC after: 6 weeks
Diffstat (limited to 'contrib/gcc')
-rw-r--r-- | contrib/gcc/c-decl.c | 2 | ||||
-rw-r--r-- | contrib/gcc/c.opt | 4 | ||||
-rw-r--r-- | contrib/gcc/common.opt | 4 | ||||
-rw-r--r-- | contrib/gcc/tree-nested.c | 6 |
4 files changed, 15 insertions, 1 deletions
diff --git a/contrib/gcc/c-decl.c b/contrib/gcc/c-decl.c index 64a6fa8..fbafc0d 100644 --- a/contrib/gcc/c-decl.c +++ b/contrib/gcc/c-decl.c @@ -4340,6 +4340,8 @@ grokdeclarator (const struct c_declarator *declarator, pedwarn ("ISO C90 forbids variable-size array %qs", name); } + if (warn_variable_decl) + warning (0, "variable-sized array %qs", name); } if (integer_zerop (size)) diff --git a/contrib/gcc/c.opt b/contrib/gcc/c.opt index 8769657..038fc51 100644 --- a/contrib/gcc/c.opt +++ b/contrib/gcc/c.opt @@ -404,6 +404,10 @@ Wtraditional C ObjC Var(warn_traditional) Warn about features not present in traditional C +Wtrampolines +Common Var(warn_trampolines) +Warn when trampolines are emitted + Wtrigraphs C ObjC C++ ObjC++ Warn if trigraphs are encountered that might affect the meaning of the program diff --git a/contrib/gcc/common.opt b/contrib/gcc/common.opt index 367e540..2270d0d 100644 --- a/contrib/gcc/common.opt +++ b/contrib/gcc/common.opt @@ -189,6 +189,10 @@ Wunused-variable Common Var(warn_unused_variable) Warn when a variable is unused +Wvariable-decl +Common Var(warn_variable_decl) +Warn about variable-sized declarations. + Wvolatile-register-var Common Var(warn_register_var) Warn when a register variable is declared volatile diff --git a/contrib/gcc/tree-nested.c b/contrib/gcc/tree-nested.c index 06fbbc9..9efcd98 100644 --- a/contrib/gcc/tree-nested.c +++ b/contrib/gcc/tree-nested.c @@ -750,7 +750,7 @@ check_for_nested_with_variably_modified (tree fndecl, tree orig_fndecl) for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested) { for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = TREE_CHAIN (arg)) - if (variably_modified_type_p (TREE_TYPE (arg), 0), orig_fndecl) + if (variably_modified_type_p (TREE_TYPE (arg), orig_fndecl)) return true; if (check_for_nested_with_variably_modified (cgn->decl, orig_fndecl)) @@ -1621,6 +1621,10 @@ convert_tramp_reference (tree *tp, int *walk_subtrees, void *data) it doesn't need a trampoline. */ if (DECL_NO_STATIC_CHAIN (decl)) break; + if (warn_trampolines) + { + warning(0, "local function address taken needing trampoline generation"); + } /* Lookup the immediate parent of the callee, as that's where we need to insert the trampoline. */ |