diff options
author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-25 03:59:00 +0000 |
---|---|---|
committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-25 03:59:00 +0000 |
commit | 8b6866afc342340bd8d8674caf6d773afe0de5f1 (patch) | |
tree | 9643535c0dbab111233baa2e45e430fa4ca4774d /gcc/c-decl.c | |
parent | 06386baa96678e4b6bf4410164fb716943804b4d (diff) | |
download | gcc-8b6866afc342340bd8d8674caf6d773afe0de5f1.tar.gz |
* c-common.c (unsigned_conversion_warning): Move warning control
from if() to warning(OPT_*).
(c_common_truthvalue_conversion): Likewise.
(c_do_switch_warnings): Likewise.
* c-decl.c (diagnose_mismatched_decls): Likewise.
(diagnose_mismatched_decls): Likewise.
(define_label): Likewise.
(grokdeclarator): Likewise.
* c-format.c (check_format_info): Likewise.
* c-lex.c (interpret_integer): Likwise.
(lex_string): Likewise.
* c-opts.c (c_common_post_options): Likewise.
* c-parser.c (c_parser_unary_expression): Likewise.
* c-pragma.c (handle_pragma_redefine_extname): Likewise.
(handle_pragma_extern_prefix): Likewise.
* c-typeck.c (build_binary_op): Likewise.
* gcse.c (is_too_expensive): Likewise.
* opts.c (decode_options): Likewise.
* stor-layout.c (place_field): Likewise.
* tree-cfg.c (remove_bb): Likewise.
* c.opt (-Wreturn-type): Add Var(warn_return_type).
* flags.h (warn_return_type): Remove.
* toplev.c (warn_return_type): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100135 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 8653d8f2b2d..efbd512d062 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1154,9 +1154,9 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, else if (TREE_PUBLIC (newdecl)) warning (0, "%Jbuilt-in function %qD declared as non-function", newdecl, newdecl); - else if (warn_shadow) - warning (0, "%Jdeclaration of %qD shadows a built-in function", - newdecl, newdecl); + else + warning (OPT_Wshadow, "%Jdeclaration of %qD shadows " + "a built-in function", newdecl, newdecl); return false; } @@ -1270,9 +1270,8 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, || (DECL_INITIAL (newdecl) && !TYPE_ARG_TYPES (TREE_TYPE (newdecl))))) { - if (warn_shadow) - warning (0, "%Jdeclaration of %qD shadows a built-in function", - newdecl, newdecl); + warning (OPT_Wshadow, "%Jdeclaration of %qD shadows " + "a built-in function", newdecl, newdecl); /* Discard the old built-in function. */ return false; } @@ -2543,9 +2542,9 @@ define_label (location_t location, tree name) /*invisible=*/false, /*nested=*/false); } - if (warn_traditional && !in_system_header && lookup_name (name)) - warning (0, "%Htraditional C lacks a separate namespace for labels, " - "identifier %qE conflicts", &location, name); + if (!in_system_header && lookup_name (name)) + warning (OPT_Wtraditional, "%Htraditional C lacks a separate namespace " + "for labels, identifier %qE conflicts", &location, name); nlist_se = XOBNEW (&parser_obstack, struct c_label_list); nlist_se->next = label_context_stack_se->labels_def; @@ -4271,8 +4270,9 @@ grokdeclarator (const struct c_declarator *declarator, them for noreturn functions. */ if (VOID_TYPE_P (type) && really_funcdef) pedwarn ("function definition has qualified void return type"); - else if (warn_return_type) - warning (0, "type qualifiers ignored on function return type"); + else + warning (OPT_Wreturn_type, + "type qualifiers ignored on function return type"); type = c_build_qualified_type (type, type_quals); } @@ -6079,7 +6079,8 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) #endif if (!in_system_header) - warning (OPT_Wold_style_definition, "%Jold-style function definition", fndecl); + warning (OPT_Wold_style_definition, "%Jold-style function definition", + fndecl); /* Match each formal parameter name with its declaration. Save each decl in the appropriate TREE_PURPOSE slot of the parmids chain. */ |