diff options
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 492d2e673b7..59179dd5858 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -1102,7 +1102,7 @@ pop_scope (void) error ("label %q+D used but not defined", p); DECL_INITIAL (p) = error_mark_node; } - else + else warn_for_unused_label (p); /* Labels go in BLOCK_VARS. */ @@ -1897,7 +1897,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, } else if (warn_traditional) { - warned |= warning (OPT_Wtraditional, + warned |= warning (OPT_Wtraditional, "non-static declaration of %q+D " "follows static declaration", newdecl); } @@ -1975,7 +1975,7 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, } else if (warn_traditional) { - warned |= warning (OPT_Wtraditional, + warned |= warning (OPT_Wtraditional, "non-static declaration of %q+D " "follows static declaration", newdecl); } @@ -2046,14 +2046,14 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl, if (DECL_DECLARED_INLINE_P (newdecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (olddecl))) { - warned |= warning (OPT_Wattributes, + warned |= warning (OPT_Wattributes, "inline declaration of %qD follows " "declaration with attribute noinline", newdecl); } else if (DECL_DECLARED_INLINE_P (olddecl) && lookup_attribute ("noinline", DECL_ATTRIBUTES (newdecl))) { - warned |= warning (OPT_Wattributes, + warned |= warning (OPT_Wattributes, "declaration of %q+D with attribute " "noinline follows inline declaration ", newdecl); } @@ -2812,8 +2812,8 @@ implicit_decl_warning (tree id, tree olddecl) if (flag_isoc99) warned = pedwarn (input_location, OPT_Wimplicit_function_declaration, "implicit declaration of function %qE", id); - else - warned = warning (OPT_Wimplicit_function_declaration, + else + warned = warning (OPT_Wimplicit_function_declaration, G_("implicit declaration of function %qE"), id); if (olddecl && warned) locate_old_decl (olddecl); @@ -3497,10 +3497,10 @@ c_make_fname_decl (location_t loc, tree id, int type_dep) if (current_function_decl /* For invalid programs like this: - + void foo() const char* p = __FUNCTION__; - + the __FUNCTION__ is believed to appear in K&R style function parameter declarator. In that case we still don't have function_scope. */ @@ -4653,7 +4653,7 @@ warn_variable_length_array (tree name, tree size) } else { - if (name) + if (name) pedwarn (input_location, OPT_Wvla, "ISO C90 forbids variable length array %qE", name); @@ -4880,11 +4880,11 @@ grokdeclarator (const struct c_declarator *declarator, else { if (name) - pedwarn_c99 (loc, flag_isoc99 ? 0 : OPT_Wimplicit_int, + pedwarn_c99 (loc, flag_isoc99 ? 0 : OPT_Wimplicit_int, "type defaults to %<int%> in declaration of %qE", name); else - pedwarn_c99 (input_location, flag_isoc99 ? 0 : OPT_Wimplicit_int, + pedwarn_c99 (input_location, flag_isoc99 ? 0 : OPT_Wimplicit_int, "type defaults to %<int%> in type name"); } } @@ -4946,8 +4946,8 @@ grokdeclarator (const struct c_declarator *declarator, || storage_class == csc_typedef)) { if (storage_class == csc_auto) - pedwarn (loc, - (current_scope == file_scope) ? 0 : OPT_pedantic, + pedwarn (loc, + (current_scope == file_scope) ? 0 : OPT_pedantic, "function definition declared %<auto%>"); if (storage_class == csc_register) error_at (loc, "function definition declared %<register%>"); @@ -6833,7 +6833,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes, if (pedantic && TREE_CODE (t) == RECORD_TYPE && flexible_array_type_p (TREE_TYPE (x))) - pedwarn (DECL_SOURCE_LOCATION (x), OPT_pedantic, + pedwarn (DECL_SOURCE_LOCATION (x), OPT_pedantic, "invalid use of structure with flexible array member"); if (DECL_NAME (x)) @@ -7284,7 +7284,7 @@ build_enumerator (location_t loc, (6.4.4.3/2 in the C99 Standard). GCC allows any integer type as an extension. */ else if (!int_fits_type_p (value, integer_type_node)) - pedwarn (loc, OPT_pedantic, + pedwarn (loc, OPT_pedantic, "ISO C restricts enumerator values to range of %<int%>"); /* The ISO C Standard mandates enumerators to have type int, even @@ -7396,7 +7396,7 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, } if (warn_about_return_type) - pedwarn_c99 (loc, flag_isoc99 ? 0 + pedwarn_c99 (loc, flag_isoc99 ? 0 : (warn_return_type ? OPT_Wreturn_type : OPT_Wimplicit_int), "return type defaults to %<int%>"); @@ -7693,7 +7693,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info) if (flag_isoc99) pedwarn (DECL_SOURCE_LOCATION (decl), 0, "type of %qD defaults to %<int%>", decl); - else + else warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wmissing_parameter_type, "type of %qD defaults to %<int%>", decl); @@ -8039,7 +8039,7 @@ finish_function (void) c_determine_visibility (fndecl); /* For GNU C extern inline functions disregard inline limits. */ - if (DECL_EXTERNAL (fndecl) + if (DECL_EXTERNAL (fndecl) && DECL_DECLARED_INLINE_P (fndecl)) DECL_DISREGARD_INLINE_LIMITS (fndecl) = 1; @@ -8896,7 +8896,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs, case RID_DFLOAT32: case RID_DFLOAT64: case RID_DFLOAT128: - { + { const char *str; if (i == RID_DFLOAT32) str = "_Decimal32"; @@ -9065,7 +9065,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) && C_IS_RESERVED_WORD (scspec)); i = C_RID_CODE (scspec); if (specs->non_sc_seen_p) - warning (OPT_Wold_style_declaration, + warning (OPT_Wold_style_declaration, "%qE is not at beginning of declaration", scspec); switch (i) { @@ -9187,7 +9187,7 @@ finish_declspecs (struct c_declspecs *specs) else if (specs->complex_p) { specs->typespec_word = cts_double; - pedwarn (input_location, OPT_pedantic, + pedwarn (input_location, OPT_pedantic, "ISO C does not support plain %<complex%> meaning " "%<double complex%>"); } @@ -9232,7 +9232,7 @@ finish_declspecs (struct c_declspecs *specs) specs->type = char_type_node; if (specs->complex_p) { - pedwarn (input_location, OPT_pedantic, + pedwarn (input_location, OPT_pedantic, "ISO C does not support complex integer types"); specs->type = build_complex_type (specs->type); } @@ -9258,7 +9258,7 @@ finish_declspecs (struct c_declspecs *specs) : integer_type_node); if (specs->complex_p) { - pedwarn (input_location, OPT_pedantic, + pedwarn (input_location, OPT_pedantic, "ISO C does not support complex integer types"); specs->type = build_complex_type (specs->type); } |