Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jan 2014 16:05:19 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r260593 - in stable/8/contrib/gcc: . cp
Message-ID:  <201401131605.s0DG5Jlu047784@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Mon Jan 13 16:05:18 2014
New Revision: 260593
URL: http://svnweb.freebsd.org/changeset/base/260593

Log:
  MFC	r259666, r259696:
  
  gcc: warnings from -Wformat-security
  
  Obtained from:	Apple GCC 4.2 - 5646 (Radar 5764921)

Modified:
  stable/8/contrib/gcc/c-common.c
  stable/8/contrib/gcc/c-convert.c
  stable/8/contrib/gcc/c-incpath.c
  stable/8/contrib/gcc/c-typeck.c
  stable/8/contrib/gcc/cfg.c
  stable/8/contrib/gcc/collect2.c
  stable/8/contrib/gcc/cp/cvt.c
  stable/8/contrib/gcc/cp/pt.c
  stable/8/contrib/gcc/cp/typeck.c
  stable/8/contrib/gcc/fold-const.c
  stable/8/contrib/gcc/gcc.c
  stable/8/contrib/gcc/gcov.c
  stable/8/contrib/gcc/tlink.c
Directory Properties:
  stable/8/   (props changed)
  stable/8/contrib/   (props changed)
  stable/8/contrib/gcc/   (props changed)

Modified: stable/8/contrib/gcc/c-common.c
==============================================================================
--- stable/8/contrib/gcc/c-common.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/c-common.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -5922,11 +5922,11 @@ c_parse_error (const char *gmsgid, enum 
       message = NULL;
     }
   else
-    error (gmsgid);
+    error (gmsgid, "");
 
   if (message)
     {
-      error (message);
+      error (message, "");
       free (message);
     }
 #undef catenate_messages

Modified: stable/8/contrib/gcc/c-convert.c
==============================================================================
--- stable/8/contrib/gcc/c-convert.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/c-convert.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -80,7 +80,7 @@ convert (tree type, tree expr)
   if ((invalid_conv_diag
        = targetm.invalid_conversion (TREE_TYPE (expr), type)))
     {
-      error (invalid_conv_diag);
+      error (invalid_conv_diag, "");
       return error_mark_node;
     }
 

Modified: stable/8/contrib/gcc/c-incpath.c
==============================================================================
--- stable/8/contrib/gcc/c-incpath.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/c-incpath.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -72,7 +72,7 @@ free_path (struct cpp_dir *path, int rea
     case REASON_DUP_SYS:
       fprintf (stderr, _("ignoring duplicate directory \"%s\"\n"), path->name);
       if (reason == REASON_DUP_SYS)
-	fprintf (stderr,
+	fprintf (stderr, "%s",
  _("  as it is a non-system directory that duplicates a system directory\n"));
       break;
 
@@ -292,16 +292,16 @@ merge_include_chains (cpp_reader *pfile,
     {
       struct cpp_dir *p;
 
-      fprintf (stderr, _("#include \"...\" search starts here:\n"));
+      fprintf (stderr, "%s", _("#include \"...\" search starts here:\n"));
       for (p = heads[QUOTE];; p = p->next)
 	{
 	  if (p == heads[BRACKET])
-	    fprintf (stderr, _("#include <...> search starts here:\n"));
+	    fprintf (stderr, "%s", _("#include <...> search starts here:\n"));
 	  if (!p)
 	    break;
 	  fprintf (stderr, " %s\n", p->name);
 	}
-      fprintf (stderr, _("End of search list.\n"));
+      fprintf (stderr, "%s", _("End of search list.\n"));
     }
 }
 

Modified: stable/8/contrib/gcc/c-typeck.c
==============================================================================
--- stable/8/contrib/gcc/c-typeck.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/c-typeck.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -2571,7 +2571,7 @@ convert_arguments (tree typelist, tree v
       else if ((invalid_func_diag =
 		targetm.calls.invalid_arg_for_unprototyped_fn (typelist, fundecl, val)))
 	{
-	  error (invalid_func_diag);
+	  error (invalid_func_diag, "");
 	  return error_mark_node;
 	}
       else
@@ -2762,7 +2762,7 @@ build_unary_op (enum tree_code code, tre
   if ((invalid_op_diag
        = targetm.invalid_unary_op (code, TREE_TYPE (xarg))))
     {
-      error (invalid_op_diag);
+      error (invalid_op_diag, "");
       return error_mark_node;
     }
 
@@ -7802,7 +7802,7 @@ build_binary_op (enum tree_code code, tr
   if ((invalid_op_diag
        = targetm.invalid_binary_op (code, type0, type1)))
     {
-      error (invalid_op_diag);
+      error (invalid_op_diag, "");
       return error_mark_node;
     }
 

Modified: stable/8/contrib/gcc/cfg.c
==============================================================================
--- stable/8/contrib/gcc/cfg.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/cfg.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -830,7 +830,7 @@ dump_cfg_bb_info (FILE *file, basic_bloc
 	else
 	  fprintf (file, ", ");
 	first = false;
-	fprintf (file, bb_bitnames[i]);
+	fprintf (file, "%s", bb_bitnames[i]);
       }
   if (!first)
     fprintf (file, ")");

Modified: stable/8/contrib/gcc/collect2.c
==============================================================================
--- stable/8/contrib/gcc/collect2.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/collect2.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -1562,10 +1562,10 @@ collect_execute (const char *prog, char 
       if (err != 0)
 	{
 	  errno = err;
-	  fatal_perror (errmsg);
+	  fatal_perror ("%s", errmsg);
 	}
       else
-	fatal (errmsg);
+	fatal ("%s", errmsg);
     }
 
   return pex;
@@ -2050,10 +2050,10 @@ scan_prog_file (const char *prog_name, e
       if (err != 0)
 	{
 	  errno = err;
-	  fatal_perror (errmsg);
+	  fatal_perror ("%s", errmsg);
 	}
       else
-	fatal (errmsg);
+	fatal ("%s", errmsg);
     }
 
   int_handler  = (void (*) (int)) signal (SIGINT,  SIG_IGN);

Modified: stable/8/contrib/gcc/cp/cvt.c
==============================================================================
--- stable/8/contrib/gcc/cp/cvt.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/cp/cvt.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -615,7 +615,7 @@ ocp_convert (tree type, tree expr, int c
   if ((invalid_conv_diag
        = targetm.invalid_conversion (TREE_TYPE (expr), type)))
     {
-      error (invalid_conv_diag);
+      error (invalid_conv_diag, "");
       return error_mark_node;
     }
 

Modified: stable/8/contrib/gcc/cp/pt.c
==============================================================================
--- stable/8/contrib/gcc/cp/pt.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/cp/pt.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -8925,7 +8925,7 @@ tsubst_copy_and_build (tree t,
 				     /*template_arg_p=*/false,
 				     &error_msg);
 	if (error_msg)
-	  error (error_msg);
+	  error ("%s", error_msg);
 	if (!function_p && TREE_CODE (decl) == IDENTIFIER_NODE)
 	  decl = unqualified_name_lookup_error (decl);
 	return decl;

Modified: stable/8/contrib/gcc/cp/typeck.c
==============================================================================
--- stable/8/contrib/gcc/cp/typeck.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/cp/typeck.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -3091,7 +3091,7 @@ build_binary_op (enum tree_code code, tr
   if ((invalid_op_diag
        = targetm.invalid_binary_op (code, type0, type1)))
     {
-      error (invalid_op_diag);
+      error (invalid_op_diag, "");
       return error_mark_node;
     }
 
@@ -4018,7 +4018,7 @@ build_unary_op (enum tree_code code, tre
 				    : code),
 				   TREE_TYPE (xarg))))
     {
-      error (invalid_op_diag);
+      error (invalid_op_diag, "");
       return error_mark_node;
     }
 

Modified: stable/8/contrib/gcc/fold-const.c
==============================================================================
--- stable/8/contrib/gcc/fold-const.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/fold-const.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -992,7 +992,7 @@ fold_overflow_warning (const char* gmsgi
 	}
     }
   else if (issue_strict_overflow_warning (wc))
-    warning (OPT_Wstrict_overflow, gmsgid);
+    warning (OPT_Wstrict_overflow, "%s", gmsgid);
 }
 
 /* Return true if the built-in mathematical function specified by CODE

Modified: stable/8/contrib/gcc/gcc.c
==============================================================================
--- stable/8/contrib/gcc/gcc.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/gcc.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -2963,7 +2963,7 @@ execute (void)
       if (errmsg != NULL)
 	{
 	  if (err == 0)
-	    fatal (errmsg);
+	    fatal ("%s", errmsg);
 	  else
 	    {
 	      errno = err;
@@ -6514,7 +6514,7 @@ main (int argc, char **argv)
 
       if (! verbose_flag)
 	{
-	  printf (_("\nFor bug reporting instructions, please see:\n"));
+	  printf ("%s", _("\nFor bug reporting instructions, please see:\n"));
 	  printf ("%s.\n", bug_report_url);
 
 	  return (0);

Modified: stable/8/contrib/gcc/gcov.c
==============================================================================
--- stable/8/contrib/gcc/gcov.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/gcov.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -417,7 +417,7 @@ print_version (void)
   fnotice (stdout, "gcov (GCC) %s\n", version_string);
   fprintf (stdout, "Copyright %s 2006 Free Software Foundation, Inc.\n",
 	   _("(C)"));
-  fnotice (stdout,
+  fnotice (stdout, "%s",
 	   _("This is free software; see the source for copying conditions.\n"
 	     "There is NO warranty; not even for MERCHANTABILITY or \n"
 	     "FITNESS FOR A PARTICULAR PURPOSE.\n\n"));

Modified: stable/8/contrib/gcc/tlink.c
==============================================================================
--- stable/8/contrib/gcc/tlink.c	Mon Jan 13 15:32:37 2014	(r260592)
+++ stable/8/contrib/gcc/tlink.c	Mon Jan 13 16:05:18 2014	(r260593)
@@ -381,7 +381,7 @@ read_repo_file (file *f)
   FILE *stream = fopen (f->key, "r");
 
   if (tlink_verbose >= 2)
-    fprintf (stderr, _("collect: reading %s\n"), f->key);
+    fprintf (stderr, "%s", _("collect: reading %s\n"), f->key);
 
   while (fscanf (stream, "%c ", &c) == 1)
     {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401131605.s0DG5Jlu047784>