aboutsummaryrefslogtreecommitdiff
path: root/gcc/cccp.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>1999-11-25 16:58:32 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>1999-11-25 16:58:32 +0000
commit913d08334a78012ba496b669bc0077a98d6e9b3c (patch)
tree255cdd5d37dc128a7ad564ade1d1db3d7b9f9af2 /gcc/cccp.c
parent7a12ace5bc2c9be0cbcd4b13bcd89f2e79a16318 (diff)
downloadgcc-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/cccp.c')
-rw-r--r--gcc/cccp.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 0e77a91..ebdbd4c 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -6064,13 +6064,20 @@ check_macro_name (symname, assertion)
sym_length = p - symname;
if (sym_length == 0
|| (sym_length == 1 && *symname == 'L' && (*p == '\'' || *p == '"')))
- error (assertion ? "invalid assertion name" : "invalid macro name");
+ {
+ if (assertion)
+ error ("invalid assertion name");
+ else
+ error ("invalid macro name");
+ }
else if (!is_idstart[*symname]
|| (sym_length == 7 && ! bcmp (symname, "defined", 7)))
- error ((assertion
- ? "invalid assertion name `%.*s'"
- : "invalid macro name `%.*s'"),
- sym_length, symname);
+ {
+ if (assertion)
+ error ("invalid assertion name `%.*s'", sym_length, symname);
+ else
+ error ("invalid macro name `%.*s'", sym_length, symname);
+ }
return sym_length;
}
@@ -7419,9 +7426,12 @@ do_xifdef (buf, limit, op, keyword)
if (end == buf) {
skip = (keyword->type == T_IFDEF);
if (! traditional)
- pedwarn (end == limit ? "`#%s' with no argument"
- : "`#%s' argument starts with punctuation",
- keyword->name);
+ {
+ if (end == limit)
+ pedwarn ("`#%s' with no argument", keyword->name);
+ else
+ pedwarn ("`#%s' argument starts with punctuation", keyword->name);
+ }
} else {
HASHNODE *hp;
@@ -9627,7 +9637,10 @@ vwarning_with_line (line, msgid, args)
if (ip != NULL) {
fwrite (ip->nominal_fname, sizeof ip->nominal_fname[0],
ip->nominal_fname_len, stderr);
- fprintf (stderr, line ? ":%d: " : ": ", line);
+ if (line)
+ fprintf (stderr, ":%d: ", line);
+ else
+ fputs (": ", stderr);
}
notice ("warning: ");
vnotice (msgid, args);