tree-sra.c (dump_dereferences_table): Avoid -Wformat-security warning.
authorDavid Howells <dhowells@redhat.com>
Thu, 12 Feb 2015 21:29:21 +0000 (21:29 +0000)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 12 Feb 2015 21:29:21 +0000 (22:29 +0100)
* 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
gcc/opts.c
gcc/tree-sra.c
gcc/tree-ssa-uninit.c

index b58657e83925e68c61c3d41d588847f7fc6027a2..c3ed1cb811f84d23fa03c163c88a341786ee7058 100644 (file)
@@ -1,3 +1,10 @@
+2015-02-12  David Howells  <dhowells@redhat.com>
+
+       * 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  <jakub@redhat.com>
 
        * dwarf2out.c (output_die): Use "%s", name instead of name to
index 84627c4e379107444a35af2287785f3986aaf427..4a1ed0e48b30a21f1a9c7af76e87f9d1cafb8916 100644 (file)
@@ -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),
index ad9584ed3d6333f998623f208a0978ba0391c24c..c6726a89cb9adc669c3252a4926b45686ed4f795 100644 (file)
@@ -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)
     {
index d04c185cc82559a495beaf7e548d8549b9f4a7c2..19a3e8231f3f02711c5a3f2cb231667381995ed2 100644 (file)
@@ -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 ();