From 81018dcf98af6346d1bfcfefa5cc9e9c250ac79b Mon Sep 17 00:00:00 2001 From: David Howells Date: Thu, 12 Feb 2015 21:29:21 +0000 Subject: [PATCH] tree-sra.c (dump_dereferences_table): Avoid -Wformat-security warning. * tree-sra.c (dump_dereferences_table): Avoid -Wformat-security warning. * tree-ssa-uninit.c (dump_predicates): Likewise. * opts.c (print_filtered_help): Likewise. From-SVN: r220662 --- gcc/ChangeLog | 7 +++++++ gcc/opts.c | 4 ++-- gcc/tree-sra.c | 2 +- gcc/tree-ssa-uninit.c | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b58657e8392..c3ed1cb811f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-02-12 David Howells + + * tree-sra.c (dump_dereferences_table): Avoid -Wformat-security + warning. + * tree-ssa-uninit.c (dump_predicates): Likewise. + * opts.c (print_filtered_help): Likewise. + 2015-02-12 Jakub Jelinek * dwarf2out.c (output_die): Use "%s", name instead of name to diff --git a/gcc/opts.c b/gcc/opts.c index 84627c4e379..4a1ed0e48b3 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -1106,7 +1106,7 @@ print_filtered_help (unsigned int include_flags, if (* (const char **) flag_var != NULL) snprintf (new_help + strlen (new_help), sizeof (new_help) - strlen (new_help), - * (const char **) flag_var); + "%s", * (const char **) flag_var); } else if (option->var_type == CLVC_ENUM) { @@ -1120,7 +1120,7 @@ print_filtered_help (unsigned int include_flags, arg = _("[default]"); snprintf (new_help + strlen (new_help), sizeof (new_help) - strlen (new_help), - arg); + "%s", arg); } else sprintf (new_help + strlen (new_help), diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index ad9584ed3d6..c6726a89cb9 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -3987,7 +3987,7 @@ dump_dereferences_table (FILE *f, const char *str, HOST_WIDE_INT *table) { basic_block bb; - fprintf (dump_file, str); + fprintf (dump_file, "%s", str); FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun), EXIT_BLOCK_PTR_FOR_FN (cfun), next_bb) { diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index d04c185cc82..19a3e8231f3 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -820,7 +820,7 @@ dump_predicates (gimple usestmt, pred_chain_union preds, { size_t i, j; pred_chain one_pred_chain = vNULL; - fprintf (dump_file, msg); + fprintf (dump_file, "%s", msg); print_gimple_stmt (dump_file, usestmt, 0, 0); fprintf (dump_file, "is guarded by :\n\n"); size_t num_preds = preds.length (); -- 2.30.2