diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 1999-11-25 16:58:32 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 1999-11-25 16:58:32 +0000 |
commit | 913d08334a78012ba496b669bc0077a98d6e9b3c (patch) | |
tree | 255cdd5d37dc128a7ad564ade1d1db3d7b9f9af2 /gcc/c-decl.c | |
parent | 7a12ace5bc2c9be0cbcd4b13bcd89f2e79a16318 (diff) | |
download | gcc-913d08334a78012ba496b669bc0077a98d6e9b3c.zip gcc-913d08334a78012ba496b669bc0077a98d6e9b3c.tar.gz gcc-913d08334a78012ba496b669bc0077a98d6e9b3c.tar.bz2 |
c-common.c (check_format_info): Don't call a variadic function with a non-literal format string.
* c-common.c (check_format_info): Don't call a variadic function
with a non-literal format string.
* c-decl.c (grokdeclarator, start_struct, finish_struct): Likewise.
* c-typeck.c (build_component_ref, build_unary_op, lvalue_or_else,
pedantic_lvalue_warning, error_init, pedwarn_init, warning_init):
Likewise.
* cccp.c (check_macro_name, do_xifdef, vwarning_with_line):
Likewise.
* collect2.c (collect_wait): Likewise.
* dbxout.c (dbxout_type): Likewise.
* gcc.c (do_spec_1): Likewise.
* genemit.c (gen_insn, gen_expand): Likewise.
* genrecog.c (write_switch, write_subroutine): Likewise.
* mips-tfile.c (catch_signal, botch): Likewise.
* print-rtl.c (print_rtx): Likewise.
* toplev.c (default_print_error_function, report_error_function,
_fatal_insn): Likewise.
From-SVN: r30666
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 60e6e0e..39ec856 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4262,12 +4262,18 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) ; else { - error ((decl_context == FIELD - ? "storage class specified for structure field `%s'" - : (decl_context == PARM - ? "storage class specified for parameter `%s'" - : "storage class specified for typename")), - name); + switch (decl_context) + { + case FIELD: + error ("storage class specified for structure field `%s'", name); + break; + case PARM: + error ("storage class specified for parameter `%s'", name); + break; + default: + error ("storage class specified for typename"); + break; + } specbits &= ~ ((1 << (int) RID_TYPEDEF) | (1 << (int) RID_REGISTER) | (1 << (int) RID_AUTO) | (1 << (int) RID_STATIC) | (1 << (int) RID_EXTERN)); @@ -5243,8 +5249,8 @@ start_struct (code, name) C_TYPE_BEING_DEFINED (ref) = 1; TYPE_PACKED (ref) = flag_pack_struct; if (TYPE_FIELDS (ref)) - error ((code == UNION_TYPE ? "redefinition of `union %s'" - : "redefinition of `struct %s'"), + error ("redefinition of `%s %s'", + code == UNION_TYPE ? "union" : "struct", IDENTIFIER_POINTER (name)); return ref; @@ -5316,11 +5322,11 @@ finish_struct (t, fieldlist, attributes) if (in_parm_level_p ()) { if (pedantic) - pedwarn ((TREE_CODE (t) == UNION_TYPE ? "union defined inside parms" - : "structure defined inside parms")); + pedwarn ("%s defined inside parms", + TREE_CODE (t) == UNION_TYPE ? "union" : "structure"); else if (! flag_traditional) - warning ((TREE_CODE (t) == UNION_TYPE ? "union defined inside parms" - : "structure defined inside parms")); + warning ("%s defined inside parms", + TREE_CODE (t) == UNION_TYPE ? "union" : "structure"); } old_momentary = suspend_momentary (); @@ -5332,10 +5338,9 @@ finish_struct (t, fieldlist, attributes) break; if (x == 0) - pedwarn ((fieldlist - ? "%s has no named members" - : "%s has no members"), - TREE_CODE (t) == UNION_TYPE ? "union" : "struct"); + pedwarn ("%s has no %smembers", + TREE_CODE (t) == UNION_TYPE ? "union" : "struct", + fieldlist ? "named " : ""); } /* Install struct as DECL_CONTEXT of each field decl. |