diff options
author | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-25 04:18:19 +0000 |
---|---|---|
committer | dj <dj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-05-25 04:18:19 +0000 |
commit | 9b2d6d13808845e60fdd0047dcf2b626c641f75d (patch) | |
tree | f2b16cd3336a6bcdf0b58025f27679c1e19056ed /gcc/cp | |
parent | 8b6866afc342340bd8d8674caf6d773afe0de5f1 (diff) | |
download | gcc-9b2d6d13808845e60fdd0047dcf2b626c641f75d.tar.gz |
* common.opt (-Wattributes): New. Default true.
* doc/invoke.texi (-Wno-attributes): Document.
* attribs.c (decl_attributes): Move warning control from if() to
warning(OPT_*).
* c-common.c (handle_packed_attribute): Likewise.
(handle_nocommon_attribute): Likewise.
(handle_common_attribute): Likewise.
(handle_noreturn_attribute): Likewise.
(handle_noinline_attribute): Likewise.
(handle_always_inline_attribute): Likewise.
(handle_used_attribute): Likewise.
(handle_unused_attribute): Likewise.
(handle_const_attribute): Likewise.
(handle_transparent_union_attribute): Likewise.
(handle_constructor_attribute): Likewise.
(handle_destructor_attribute): Likewise.
(handle_mode_attribute): Likewise.
(handle_alias_attribute): Likewise.
(handle_visibility_attribute): Likewise.
(handle_tls_model_attribute): Likewise.
(handle_malloc_attribute): Likewise.
(handle_returns_twice_attribute): Likewise.
(handle_pure_attribute): Likewise.
(handle_deprecated_attribute): Likewise.
(handle_vector_size_attribute): Likewise.
(handle_nothrow_attribute): Likewise.
(handle_cleanup_attribute): Likewise.
(handle_warn_unused_result_attribute): Likewise.
(handle_sentinel_attribute): Likewise.
* c-decl.c (diagnose_mismatched_decls): Likewise.
(start_decl): Likewise.
(grokdeclarator): Likewise.
(start_function): Likewise.
* c-format.c (check_function_format): Likewise.
* stor-layout.c (place_field): Likewise.
(finalize_record_size): Likewise.
* tree.c (handle_dll_attribute)): Likewise.
* varasm.c (default_assemble_visibility): Likewise.
* config/darwin.c (darwin_handle_weak_import_attribute): Likewise.
(darwin_assemble_visibility): Likewise.
* config/arc/arc.c (arc_handle_interrupt_attribute): Likewise.
* config/arm/arm.c (arm_handle_fndecl_attribute): Likewise.
(arm_handle_isr_attribute): Likewise.
* config/avr/avr.c (avr_handle_progmem_attribute): Likewise.
(avr_handle_fndecl_attribute): Likewise.
* config/bfin/bfin.c (handle_int_attribute): Likewise.
* config/c4x/c4x.c (c4x_handle_fntype_attribute): Likewise.
* config/h8300/h8300.c (h8300_handle_fndecl_attribute): Likewise.
(h8300_handle_eightbit_data_attribute): Likewise.
(h8300_handle_tiny_data_attribute): Likewise.
* config/i386/i386.c (ix86_handle_cdecl_attribute): Likewise.
(ix86_handle_regparm_attribute): Likewise.
(ix86_handle_struct_attribute): Likewise.
* config/i386/winnt.c (ix86_handle_shared_attribute): Likewise.
(i386_pe_encode_section_info): Likewise.
* config/ia64/ia64.c (ia64_handle_model_attribute): Likewise.
* config/ip2k/ip2k.c (ip2k_handle_progmem_attribute): Likewise.
(ip2k_handle_fndecl_attribute): Likewise.
* config/m32r/m32r.c (m32r_handle_model_attribute): Likewise.
* config/m68hc11/m68hc11 (m68hc11_handle_page0_attribute): Likewise.
(m68hc11_handle_fntype_attribute): Likewise.
(m68hc11_encode_section_info): Likewise.
* config/m68k/m68k.c (m68k_handle_fndecl_attribute): Likewise.
* config/mcore/mcore.c (mcore_handle_naked_attribute): Likewise.
* config/ns32k/ns32k.c (ns32k_handle_fntype_attribute): Likewise.
* config/rs6000/rs6000.c (rs6000_handle_longcall_attribute): Likewise.
* config/sh/sh.c (sh_handle_interrupt_handler_attribute): Likewise.
(sh_handle_sp_switch_attribute): Likewise.
(sh_handle_trap_exit_attribute): Likewise.
* config/sh/symbian.c (sh_symbian_dllimport_p): Likewise.
(sh_symbian_handle_dll_attribute): Likewise.
* config/stormy16/stormy16.c (xstormy16_handle_interrupt_attribute): Likewise.
(xstormy16_handle_below100_attribute): Likewise.
* config/v850/v850.c (v850_handle_interrupt_attribute): Likewise.
[testsuite]
* gcc.dg/Wattributes-1.c: New.
* gcc.dg/Wattributes-2.c: New.
* gcc.dg/Wattributes-3.c: New.
[cp]
* decl.c (duplicate_decls): Move warning control from if() to
warning(OPT_*).
* name-lookup.c (parse_using_directive): Likewise.
* parser.c (cp_parser_elaborated_type_specifier): Likewise.
(cp_parser_init_declarator): Likewise.
* tree.c (handle_com_interface_attribute): Likewise.
[java]
* class.c (set_constant_value): Move warning control from if() to
warning(OPT_*).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100136 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/decl.c | 20 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 2 | ||||
-rw-r--r-- | gcc/cp/parser.c | 6 | ||||
-rw-r--r-- | gcc/cp/tree.c | 3 |
5 files changed, 27 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 524c943b171..aa8b26c4a11 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2005-05-25 DJ Delorie <dj@redhat.com> + + * decl.c (duplicate_decls): Move warning control from if() to + warning(OPT_*). + * name-lookup.c (parse_using_directive): Likewise. + * parser.c (cp_parser_elaborated_type_specifier): Likewise. + (cp_parser_init_declarator): Likewise. + * tree.c (handle_com_interface_attribute): Likewise. + 2005-05-24 Ziemowit Laski <zlaski@apple.com> * class.c (layout_class_type): Do not issue C++ ABI warnings diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0da99373e81..d3544172bc4 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1051,17 +1051,18 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_UNINLINABLE (olddecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl))) { - warning (0, "%Jfunction %qD redeclared as inline", newdecl, newdecl); - warning (0, "%Jprevious declaration of %qD with attribute noinline", - olddecl, olddecl); + warning (OPT_Wattributes, "%Jfunction %qD redeclared as inline", + newdecl, newdecl); + warning (OPT_Wattributes, "%Jprevious declaration of %qD " + "with attribute noinline", olddecl, olddecl); } else if (DECL_DECLARED_INLINE_P (olddecl) && DECL_UNINLINABLE (newdecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl))) { - warning (0, "%Jfunction %qD redeclared with attribute noinline", - newdecl, newdecl); - warning (0, "%Jprevious declaration of %qD was inline", + warning (OPT_Wattributes, "%Jfunction %qD redeclared with " + "attribute noinline", newdecl, newdecl); + warning (OPT_Wattributes, "%Jprevious declaration of %qD was inline", olddecl, olddecl); } } @@ -1802,9 +1803,10 @@ duplicate_decls (tree newdecl, tree olddecl) && DECL_VISIBILITY_SPECIFIED (newdecl) && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl)) { - warning (0, "%J%qD: visibility attribute ignored because it", - newdecl, newdecl); - warning (0, "%Jconflicts with previous declaration here", olddecl); + warning (OPT_Wattributes, "%J%qD: visibility attribute ignored " + "because it", newdecl, newdecl); + warning (OPT_Wattributes, "%Jconflicts with previous " + "declaration here", olddecl); } /* Choose the declaration which specified visibility. */ if (DECL_VISIBILITY_SPECIFIED (olddecl)) diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 0bb8888e8a3..bd83695cd0a 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -3207,7 +3207,7 @@ parse_using_directive (tree namespace, tree attribs) DECL_NAMESPACE_ASSOCIATIONS (namespace)); } else - warning (0, "%qD attribute directive ignored", name); + warning (OPT_Wattributes, "%qD attribute directive ignored", name); } } diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 2527fb2f551..a0d71b3141f 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10024,7 +10024,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser, /* Warn about attributes. They are ignored. */ if (attributes) - warning (0, "type attributes are honored only at type definition"); + warning (OPT_Wattributes, + "type attributes are honored only at type definition"); type = xref_tag (tag_type, identifier, ts, parser->num_template_parameter_lists); @@ -10869,7 +10870,8 @@ cp_parser_init_declarator (cp_parser* parser, attributes -- but ignores them. */ if (cp_parser_allow_gnu_extensions_p (parser) && is_parenthesized_init) if (cp_parser_attributes_opt (parser)) - warning (0, "attributes after parenthesized initializer ignored"); + warning (OPT_Wattributes, + "attributes after parenthesized initializer ignored"); /* For an in-class declaration, use `grokfield' to create the declaration. */ diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 114275cd419..64a5aa5bd25 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1769,7 +1769,8 @@ handle_com_interface_attribute (tree* node, || !CLASS_TYPE_P (*node) || *node != TYPE_MAIN_VARIANT (*node)) { - warning (0, "%qE attribute can only be applied to class definitions", name); + warning (OPT_Wattributes, "%qE attribute can only be applied " + "to class definitions", name); return NULL_TREE; } |