Commit b323323f by Lee Millward

typeck.c (string_conv_p): Pass appropiate OPT_Wxxxx values when calling warning().

       * typeck.c (string_conv_p): Pass appropiate
       OPT_Wxxxx values when calling warning().
       (build_array_ref, cxx_mark_addressable): Likewise.
       (check_return_expr): Likewise.

       * init.c (perform_member_init): Likewise.
       (sort_mem_initializers, emit_mem_initializers): Likewise.

       * class.c (check_field_decls): Likewise.
       (warn_about_ambiguous_bases): Likewise.

       * decl.c (pop_label, poplevel): Likewise.
       (duplicate_decls, grok_op_properties): Likewise.
       (start_preparsed_function, finish_function): Likewise.

       * name-lookup.c (pushdecl_maybe_friend): Likewise.
       (pushdecl_maybe_friend): Likewise.

       * parser.c (cp_parser_warn_min_max): Likewise.
       (cp_parser_cast_expression): Likewise.

       * method.c (lazily_declare_fn): Likewise.
       * cvt.c (convert_to_void): Likewise.
       * mangle.c (finish_mangling): Likewise.
       * cp-gimplify.c (gimplify_expr_stmt): Likewise
.

From-SVN: r110567
parent 9b43c474
2006-02-03 Lee Millward <lee.millward@gmail.com>
* typeck.c (string_conv_p): Pass appropiate
OPT_Wxxxx values when calling warning().
(build_array_ref, cxx_mark_addressable): Likewise.
(check_return_expr): Likewise.
* init.c (perform_member_init): Likewise.
(sort_mem_initializers, emit_mem_initializers): Likewise.
* class.c (check_field_decls): Likewise.
(warn_about_ambiguous_bases): Likewise.
* decl.c (pop_label, poplevel): Likewise.
(duplicate_decls, grok_op_properties): Likewise.
(start_preparsed_function, finish_function): Likewise.
* name-lookup.c (pushdecl_maybe_friend): Likewise.
(pushdecl_maybe_friend): Likewise.
* parser.c (cp_parser_warn_min_max): Likewise.
(cp_parser_cast_expression): Likewise.
* method.c (lazily_declare_fn): Likewise.
* cvt.c (convert_to_void): Likewise.
* mangle.c (finish_mangling): Likewise.
* cp-gimplify.c (gimplify_expr_stmt): Likewise.
2006-02-03 Mark Mitchell <mark@codesourcery.com> 2006-02-03 Mark Mitchell <mark@codesourcery.com>
* name-lookup.c (do_class_using_decl): Use IDENTIFIER_TYPENAME_P, * name-lookup.c (do_class_using_decl): Use IDENTIFIER_TYPENAME_P,
...@@ -286,7 +314,7 @@ ...@@ -286,7 +314,7 @@
(cp_parser_asm_definition): Call cgraph_add_asm_node rather than (cp_parser_asm_definition): Call cgraph_add_asm_node rather than
assemble_asm. assemble_asm.
2006-01-16 Rafael vila de Espndola <rafael.espindola@gmail.com> 2006-01-16 Rafael �ila de Esp�dola <rafael.espindola@gmail.com>
* g++spec.c (lang_specific_spec_functions): Remove. * g++spec.c (lang_specific_spec_functions): Remove.
...@@ -558,7 +586,7 @@ ...@@ -558,7 +586,7 @@
* mangle.c (write_bare_function_type): Mangle return type for * mangle.c (write_bare_function_type): Mangle return type for
methods of Java classes methods of Java classes
2005-12-08 Thodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> 2005-12-08 Thdore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
* call.c (build_conditional_expr): Print types in error messages. * call.c (build_conditional_expr): Print types in error messages.
...@@ -570,11 +598,11 @@ ...@@ -570,11 +598,11 @@
* cp-gimplify.c (gimplify_cp_loop): Use fold_build3. * cp-gimplify.c (gimplify_cp_loop): Use fold_build3.
2005-12-07 Rafael vila de Espndola <rafael.espindola@gmail.com> 2005-12-07 Rafael �ila de Esp�dola <rafael.espindola@gmail.com>
* Make-lang.in (c++.all.build, c++.install-normal): Remove. * Make-lang.in (c++.all.build, c++.install-normal): Remove.
2005-12-07 Rafael vila de Espndola <rafael.espindola@gmail.com> 2005-12-07 Rafael �ila de Esp�dola <rafael.espindola@gmail.com>
* Make-lang.in: Remove all dependencies on s-gtype. * Make-lang.in: Remove all dependencies on s-gtype.
......
...@@ -2935,9 +2935,8 @@ check_field_decls (tree t, tree *access_decls, ...@@ -2935,9 +2935,8 @@ check_field_decls (tree t, tree *access_decls,
members. */ members. */
TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1; TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t) if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t))
&& extra_warnings) warning (OPT_Wextra, "non-static reference %q+#D in class without a constructor", x);
warning (0, "non-static reference %q+#D in class without a constructor", x);
} }
type = strip_array_types (type); type = strip_array_types (type);
...@@ -2982,9 +2981,8 @@ check_field_decls (tree t, tree *access_decls, ...@@ -2982,9 +2981,8 @@ check_field_decls (tree t, tree *access_decls,
members. */ members. */
TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1; TYPE_HAS_COMPLEX_ASSIGN_REF (t) = 1;
if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t) if (! TYPE_HAS_CONSTRUCTOR (t) && CLASSTYPE_NON_AGGREGATE (t))
&& extra_warnings) warning (OPT_Wextra, "non-static const member %q+#D in class without a constructor", x);
warning (0, "non-static const member %q+#D in class without a constructor", x);
} }
/* A field that is pseudo-const makes the structure likewise. */ /* A field that is pseudo-const makes the structure likewise. */
else if (CLASS_TYPE_P (type)) else if (CLASS_TYPE_P (type))
...@@ -3032,7 +3030,7 @@ check_field_decls (tree t, tree *access_decls, ...@@ -3032,7 +3030,7 @@ check_field_decls (tree t, tree *access_decls,
&& TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
&& !(TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t))) && !(TYPE_HAS_INIT_REF (t) && TYPE_HAS_ASSIGN_REF (t)))
{ {
warning (0, "%q#T has pointer data members", t); warning (OPT_Weffc__, "%q#T has pointer data members", t);
if (! TYPE_HAS_INIT_REF (t)) if (! TYPE_HAS_INIT_REF (t))
{ {
...@@ -4469,7 +4467,7 @@ warn_about_ambiguous_bases (tree t) ...@@ -4469,7 +4467,7 @@ warn_about_ambiguous_bases (tree t)
basetype = BINFO_TYPE (binfo); basetype = BINFO_TYPE (binfo);
if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL)) if (!lookup_base (t, basetype, ba_unique | ba_quiet, NULL))
warning (0, "virtual base %qT inaccessible in %qT due to ambiguity", warning (OPT_Wextra, "virtual base %qT inaccessible in %qT due to ambiguity",
basetype, t); basetype, t);
} }
} }
......
...@@ -361,7 +361,7 @@ gimplify_expr_stmt (tree *stmt_p) ...@@ -361,7 +361,7 @@ gimplify_expr_stmt (tree *stmt_p)
if (!IS_EMPTY_STMT (stmt) if (!IS_EMPTY_STMT (stmt)
&& !VOID_TYPE_P (TREE_TYPE (stmt)) && !VOID_TYPE_P (TREE_TYPE (stmt))
&& !TREE_NO_WARNING (stmt)) && !TREE_NO_WARNING (stmt))
warning (0, "statement with no effect"); warning (OPT_Wextra, "statement with no effect");
} }
else if (warn_unused_value) else if (warn_unused_value)
warn_if_unused_value (stmt, input_location); warn_if_unused_value (stmt, input_location);
......
...@@ -918,7 +918,7 @@ convert_to_void (tree expr, const char *implicit) ...@@ -918,7 +918,7 @@ convert_to_void (tree expr, const char *implicit)
/* The middle end does not warn about expressions that have /* The middle end does not warn about expressions that have
been explicitly cast to void, so we must do so here. */ been explicitly cast to void, so we must do so here. */
if (!TREE_SIDE_EFFECTS (expr)) if (!TREE_SIDE_EFFECTS (expr))
warning (0, "%s has no effect", implicit); warning (OPT_Wunused_value, "%s has no effect", implicit);
else else
{ {
tree e; tree e;
...@@ -950,7 +950,7 @@ convert_to_void (tree expr, const char *implicit) ...@@ -950,7 +950,7 @@ convert_to_void (tree expr, const char *implicit)
|| code == PREINCREMENT_EXPR || code == PREINCREMENT_EXPR
|| code == POSTDECREMENT_EXPR || code == POSTDECREMENT_EXPR
|| code == POSTINCREMENT_EXPR))) || code == POSTINCREMENT_EXPR)))
warning (0, "value computed is not used"); warning (OPT_Wunused_value, "value computed is not used");
} }
} }
expr = build1 (CONVERT_EXPR, void_type_node, expr); expr = build1 (CONVERT_EXPR, void_type_node, expr);
......
...@@ -361,8 +361,8 @@ pop_label (tree label, tree old_value) ...@@ -361,8 +361,8 @@ pop_label (tree label, tree old_value)
/* Avoid crashing later. */ /* Avoid crashing later. */
define_label (location, DECL_NAME (label)); define_label (location, DECL_NAME (label));
} }
else if (warn_unused_label && !TREE_USED (label)) else if (!TREE_USED (label))
warning (0, "label %q+D defined but not used", label); warning (OPT_Wunused_label, "label %q+D defined but not used", label);
} }
SET_IDENTIFIER_LABEL_VALUE (DECL_NAME (label), old_value); SET_IDENTIFIER_LABEL_VALUE (DECL_NAME (label), old_value);
...@@ -556,7 +556,7 @@ poplevel (int keep, int reverse, int functionbody) ...@@ -556,7 +556,7 @@ poplevel (int keep, int reverse, int functionbody)
&& ! TREE_USED (decl) && ! TREE_USED (decl)
&& ! DECL_IN_SYSTEM_HEADER (decl) && ! DECL_IN_SYSTEM_HEADER (decl)
&& DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl)) && DECL_NAME (decl) && ! DECL_ARTIFICIAL (decl))
warning (0, "unused variable %q+D", decl); warning (OPT_Wunused_variable, "unused variable %q+D", decl);
/* Remove declarations for all the DECLs in this level. */ /* Remove declarations for all the DECLs in this level. */
for (link = decls; link; link = TREE_CHAIN (link)) for (link = decls; link; link = TREE_CHAIN (link))
...@@ -1119,10 +1119,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) ...@@ -1119,10 +1119,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
bad choice of name. */ bad choice of name. */
if (! TREE_PUBLIC (newdecl)) if (! TREE_PUBLIC (newdecl))
{ {
if (warn_shadow) warning (OPT_Wshadow, "shadowing %s function %q#D",
warning (0, "shadowing %s function %q#D", DECL_BUILT_IN (olddecl) ? "built-in" : "library",
DECL_BUILT_IN (olddecl) ? "built-in" : "library", olddecl);
olddecl);
/* Discard the old built-in function. */ /* Discard the old built-in function. */
return NULL_TREE; return NULL_TREE;
} }
...@@ -1192,8 +1191,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) ...@@ -1192,8 +1191,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
warning (0, "ambiguates built-in declaration %q#D", warning (0, "ambiguates built-in declaration %q#D",
olddecl); olddecl);
} }
else if (warn_shadow) else
warning (0, "shadowing %s function %q#D", warning (OPT_Wshadow, "shadowing %s function %q#D",
DECL_BUILT_IN (olddecl) ? "built-in" : "library", DECL_BUILT_IN (olddecl) ? "built-in" : "library",
olddecl); olddecl);
} }
...@@ -1504,8 +1503,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) ...@@ -1504,8 +1503,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
/* Don't warn about friends, let add_friend take care of it. */ /* Don't warn about friends, let add_friend take care of it. */
&& ! (newdecl_is_friend || DECL_FRIEND_P (olddecl))) && ! (newdecl_is_friend || DECL_FRIEND_P (olddecl)))
{ {
warning (0, "redundant redeclaration of %qD in same scope", newdecl); warning (OPT_Wredundant_decls, "redundant redeclaration of %qD in same scope", newdecl);
warning (0, "previous declaration of %q+D", olddecl); warning (OPT_Wredundant_decls, "previous declaration of %q+D", olddecl);
} }
} }
...@@ -9012,7 +9011,7 @@ grok_op_properties (tree decl, bool complain) ...@@ -9012,7 +9011,7 @@ grok_op_properties (tree decl, bool complain)
} }
if (what) if (what)
warning (0, "conversion to %s%s will never use a type " warning (OPT_Wconversion, "conversion to %s%s will never use a type "
"conversion operator", "conversion operator",
ref ? "a reference to " : "", what); ref ? "a reference to " : "", what);
} }
...@@ -9103,13 +9102,13 @@ grok_op_properties (tree decl, bool complain) ...@@ -9103,13 +9102,13 @@ grok_op_properties (tree decl, bool complain)
if (TREE_CODE (ret) != REFERENCE_TYPE if (TREE_CODE (ret) != REFERENCE_TYPE
|| !same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (ret)), || !same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (ret)),
arg)) arg))
warning (0, "prefix %qD should return %qT", decl, warning (OPT_Weffc__, "prefix %qD should return %qT", decl,
build_reference_type (arg)); build_reference_type (arg));
} }
else else
{ {
if (!same_type_p (TYPE_MAIN_VARIANT (ret), arg)) if (!same_type_p (TYPE_MAIN_VARIANT (ret), arg))
warning (0, "postfix %qD should return %qT", decl, arg); warning (OPT_Weffc__, "postfix %qD should return %qT", decl, arg);
} }
} }
} }
...@@ -9138,7 +9137,7 @@ grok_op_properties (tree decl, bool complain) ...@@ -9138,7 +9137,7 @@ grok_op_properties (tree decl, bool complain)
&& (operator_code == TRUTH_ANDIF_EXPR && (operator_code == TRUTH_ANDIF_EXPR
|| operator_code == TRUTH_ORIF_EXPR || operator_code == TRUTH_ORIF_EXPR
|| operator_code == COMPOUND_EXPR)) || operator_code == COMPOUND_EXPR))
warning (0, "user-defined %qD always evaluates both arguments", warning (OPT_Weffc__, "user-defined %qD always evaluates both arguments",
decl); decl);
} }
...@@ -9152,7 +9151,7 @@ grok_op_properties (tree decl, bool complain) ...@@ -9152,7 +9151,7 @@ grok_op_properties (tree decl, bool complain)
|| operator_code == MULT_EXPR || operator_code == MULT_EXPR
|| operator_code == TRUNC_MOD_EXPR) || operator_code == TRUNC_MOD_EXPR)
&& TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == REFERENCE_TYPE) && TREE_CODE (TREE_TYPE (TREE_TYPE (decl))) == REFERENCE_TYPE)
warning (0, "%qD should return by value", decl); warning (OPT_Weffc__, "%qD should return by value", decl);
/* [over.oper]/8 */ /* [over.oper]/8 */
for (; argtypes && argtypes != void_list_node; for (; argtypes && argtypes != void_list_node;
...@@ -10183,7 +10182,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -10183,7 +10182,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
if (warn_ecpp if (warn_ecpp
&& DECL_OVERLOADED_OPERATOR_P (decl1) == NOP_EXPR && DECL_OVERLOADED_OPERATOR_P (decl1) == NOP_EXPR
&& TREE_CODE (TREE_TYPE (fntype)) == VOID_TYPE) && TREE_CODE (TREE_TYPE (fntype)) == VOID_TYPE)
warning (0, "%<operator=%> should return a reference to %<*this%>"); warning (OPT_Weffc__, "%<operator=%> should return a reference to %<*this%>");
/* Make the init_value nonzero so pushdecl knows this is not tentative. /* Make the init_value nonzero so pushdecl knows this is not tentative.
error_mark_node is replaced below (in poplevel) with the BLOCK. */ error_mark_node is replaced below (in poplevel) with the BLOCK. */
...@@ -10940,7 +10939,7 @@ finish_function (int flags) ...@@ -10940,7 +10939,7 @@ finish_function (int flags)
/* Structor return values (if any) are set by the compiler. */ /* Structor return values (if any) are set by the compiler. */
&& !DECL_CONSTRUCTOR_P (fndecl) && !DECL_CONSTRUCTOR_P (fndecl)
&& !DECL_DESTRUCTOR_P (fndecl)) && !DECL_DESTRUCTOR_P (fndecl))
warning (0, "no return statement in function returning non-void"); warning (OPT_Wreturn_type, "no return statement in function returning non-void");
/* Store the end of the function, so that we get good line number /* Store the end of the function, so that we get good line number
info for the epilogue. */ info for the epilogue. */
......
...@@ -324,7 +324,7 @@ perform_member_init (tree member, tree init) ...@@ -324,7 +324,7 @@ perform_member_init (tree member, tree init)
/* Effective C++ rule 12 requires that all data members be /* Effective C++ rule 12 requires that all data members be
initialized. */ initialized. */
if (warn_ecpp && !explicit && TREE_CODE (type) != ARRAY_TYPE) if (warn_ecpp && !explicit && TREE_CODE (type) != ARRAY_TYPE)
warning (0, "%J%qD should be initialized in the member initialization " warning (OPT_Weffc__, "%J%qD should be initialized in the member initialization "
"list", current_function_decl, member); "list", current_function_decl, member);
if (init == void_type_node) if (init == void_type_node)
...@@ -524,16 +524,16 @@ sort_mem_initializers (tree t, tree mem_inits) ...@@ -524,16 +524,16 @@ sort_mem_initializers (tree t, tree mem_inits)
if (warn_reorder && !subobject_init) if (warn_reorder && !subobject_init)
{ {
if (TREE_CODE (TREE_PURPOSE (next_subobject)) == FIELD_DECL) if (TREE_CODE (TREE_PURPOSE (next_subobject)) == FIELD_DECL)
warning (0, "%q+D will be initialized after", warning (OPT_Wreorder, "%q+D will be initialized after",
TREE_PURPOSE (next_subobject)); TREE_PURPOSE (next_subobject));
else else
warning (0, "base %qT will be initialized after", warning (OPT_Wreorder, "base %qT will be initialized after",
TREE_PURPOSE (next_subobject)); TREE_PURPOSE (next_subobject));
if (TREE_CODE (subobject) == FIELD_DECL) if (TREE_CODE (subobject) == FIELD_DECL)
warning (0, " %q+#D", subobject); warning (OPT_Wreorder, " %q+#D", subobject);
else else
warning (0, " base %qT", subobject); warning (OPT_Wreorder, " base %qT", subobject);
warning (0, "%J when initialized here", current_function_decl); warning (OPT_Wreorder, "%J when initialized here", current_function_decl);
} }
/* Look again, from the beginning of the list. */ /* Look again, from the beginning of the list. */
...@@ -681,7 +681,7 @@ emit_mem_initializers (tree mem_inits) ...@@ -681,7 +681,7 @@ emit_mem_initializers (tree mem_inits)
if (extra_warnings && !arguments if (extra_warnings && !arguments
&& DECL_COPY_CONSTRUCTOR_P (current_function_decl) && DECL_COPY_CONSTRUCTOR_P (current_function_decl)
&& TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject))) && TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject)))
warning (0, "%Jbase class %q#T should be explicitly initialized in the " warning (OPT_Wextra, "%Jbase class %q#T should be explicitly initialized in the "
"copy constructor", "copy constructor",
current_function_decl, BINFO_TYPE (subobject)); current_function_decl, BINFO_TYPE (subobject));
......
...@@ -2526,7 +2526,7 @@ static inline const char * ...@@ -2526,7 +2526,7 @@ static inline const char *
finish_mangling (const bool warn) finish_mangling (const bool warn)
{ {
if (warn_abi && warn && G.need_abi_warning) if (warn_abi && warn && G.need_abi_warning)
warning (0, "the mangled name of %qD will change in a future " warning (OPT_Wabi, "the mangled name of %qD will change in a future "
"version of GCC", "version of GCC",
G.entity); G.entity);
......
...@@ -1135,7 +1135,7 @@ lazily_declare_fn (special_function_kind sfk, tree type) ...@@ -1135,7 +1135,7 @@ lazily_declare_fn (special_function_kind sfk, tree type)
TYPE_METHODS list, which cause the destructor to be emitted TYPE_METHODS list, which cause the destructor to be emitted
in an incorrect location in the vtable. */ in an incorrect location in the vtable. */
if (warn_abi && DECL_VIRTUAL_P (fn)) if (warn_abi && DECL_VIRTUAL_P (fn))
warning (0, "vtable layout for class %qT may not be ABI-compliant" warning (OPT_Wabi, "vtable layout for class %qT may not be ABI-compliant"
"and may change in a future version of GCC due to " "and may change in a future version of GCC due to "
"implicit virtual destructor", "implicit virtual destructor",
type); type);
......
...@@ -950,8 +950,8 @@ pushdecl_maybe_friend (tree x, bool is_friend) ...@@ -950,8 +950,8 @@ pushdecl_maybe_friend (tree x, bool is_friend)
if (warn_shadow && !err) if (warn_shadow && !err)
{ {
warning (0, "declaration of %q#D shadows a parameter", x); warning (OPT_Wshadow, "declaration of %q#D shadows a parameter", x);
warning (0, "%Jshadowed declaration is here", oldlocal); warning (OPT_Wshadow, "%Jshadowed declaration is here", oldlocal);
} }
} }
...@@ -975,22 +975,22 @@ pushdecl_maybe_friend (tree x, bool is_friend) ...@@ -975,22 +975,22 @@ pushdecl_maybe_friend (tree x, bool is_friend)
if (member && !TREE_STATIC (member)) if (member && !TREE_STATIC (member))
{ {
/* Location of previous decl is not useful in this case. */ /* Location of previous decl is not useful in this case. */
warning (0, "declaration of %qD shadows a member of 'this'", warning (OPT_Wshadow, "declaration of %qD shadows a member of 'this'",
x); x);
} }
else if (oldlocal != NULL_TREE else if (oldlocal != NULL_TREE
&& TREE_CODE (oldlocal) == VAR_DECL) && TREE_CODE (oldlocal) == VAR_DECL)
{ {
warning (0, "declaration of %qD shadows a previous local", x); warning (OPT_Wshadow, "declaration of %qD shadows a previous local", x);
warning (0, "%Jshadowed declaration is here", oldlocal); warning (OPT_Wshadow, "%Jshadowed declaration is here", oldlocal);
} }
else if (oldglobal != NULL_TREE else if (oldglobal != NULL_TREE
&& TREE_CODE (oldglobal) == VAR_DECL) && TREE_CODE (oldglobal) == VAR_DECL)
/* XXX shadow warnings in outer-more namespaces */ /* XXX shadow warnings in outer-more namespaces */
{ {
warning (0, "declaration of %qD shadows a global declaration", warning (OPT_Wshadow, "declaration of %qD shadows a global declaration",
x); x);
warning (0, "%Jshadowed declaration is here", oldglobal); warning (OPT_Wshadow, "%Jshadowed declaration is here", oldglobal);
} }
} }
} }
......
...@@ -1850,7 +1850,7 @@ static inline void ...@@ -1850,7 +1850,7 @@ static inline void
cp_parser_warn_min_max (void) cp_parser_warn_min_max (void)
{ {
if (warn_deprecated && !in_system_header) if (warn_deprecated && !in_system_header)
warning (0, "minimum/maximum operators are deprecated"); warning (OPT_Wdeprecated, "minimum/maximum operators are deprecated");
} }
/* If not parsing tentatively, issue a diagnostic of the form /* If not parsing tentatively, issue a diagnostic of the form
...@@ -5416,7 +5416,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p) ...@@ -5416,7 +5416,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p)
&& !in_system_header && !in_system_header
&& !VOID_TYPE_P (type) && !VOID_TYPE_P (type)
&& current_lang_name != lang_name_c) && current_lang_name != lang_name_c)
warning (0, "use of old-style cast"); warning (OPT_Wold_style_cast, "use of old-style cast");
/* Only type conversions to integral or enumeration types /* Only type conversions to integral or enumeration types
can be used in constant-expressions. */ can be used in constant-expressions. */
......
...@@ -1499,8 +1499,8 @@ string_conv_p (tree totype, tree exp, int warn) ...@@ -1499,8 +1499,8 @@ string_conv_p (tree totype, tree exp, int warn)
} }
/* This warning is not very useful, as it complains about printf. */ /* This warning is not very useful, as it complains about printf. */
if (warn && warn_write_strings) if (warn)
warning (0, "deprecated conversion from string constant to %qT'", totype); warning (OPT_Wwrite_strings, "deprecated conversion from string constant to %qT'", totype);
return 1; return 1;
} }
...@@ -2306,7 +2306,7 @@ build_array_ref (tree array, tree idx) ...@@ -2306,7 +2306,7 @@ build_array_ref (tree array, tree idx)
while (TREE_CODE (foo) == COMPONENT_REF) while (TREE_CODE (foo) == COMPONENT_REF)
foo = TREE_OPERAND (foo, 0); foo = TREE_OPERAND (foo, 0);
if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo)) if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo))
warning (0, "subscripting array declared %<register%>"); warning (OPT_Wextra, "subscripting array declared %<register%>");
} }
type = TREE_TYPE (TREE_TYPE (array)); type = TREE_TYPE (TREE_TYPE (array));
...@@ -4438,9 +4438,9 @@ cxx_mark_addressable (tree exp) ...@@ -4438,9 +4438,9 @@ cxx_mark_addressable (tree exp)
("address of explicit register variable %qD requested", x); ("address of explicit register variable %qD requested", x);
return false; return false;
} }
else if (extra_warnings) else
warning warning
(0, "address requested for %qD, which is declared %<register%>", x); (OPT_Wextra, "address requested for %qD, which is declared %<register%>", x);
} }
TREE_ADDRESSABLE (x) = 1; TREE_ADDRESSABLE (x) = 1;
return true; return true;
...@@ -6378,7 +6378,7 @@ check_return_expr (tree retval, bool *no_warning) ...@@ -6378,7 +6378,7 @@ check_return_expr (tree retval, bool *no_warning)
} }
if (warn) if (warn)
warning (0, "%<operator=%> should return a reference to %<*this%>"); warning (OPT_Weffc__, "%<operator=%> should return a reference to %<*this%>");
} }
/* The fabled Named Return Value optimization, as per [class.copy]/15: /* The fabled Named Return Value optimization, as per [class.copy]/15:
......
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