This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Fix PR bootstrap/36664 -Wc++-compat failure on darwin


PR bootstrap/36664 is a -Wc++-compat failure on darwin in the file
config/darwin-driver.c.  I had done a cross-compile to darwin before
installing -Wc++-compat, however this particular file is entirely zapped
by a cpp conditional in a cross-compile configuration.  So it never came
up during my testing.

Anyway, I suspect this trivial patch fixes it.  Would someone test it on
darwin and make sure it fixes the problem?

If it does, okay to install?

		--Kaveh

2008-06-29  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* config/darwin-driver.c (darwin_default_min_version): Fix
	-Wc++-compat warnings.

diff -rup orig/egcc-SVN20080628/gcc/config/darwin-driver.c egcc-SVN20080628/gcc/config/darwin-driver.c
--- orig/egcc-SVN20080628/gcc/config/darwin-driver.c	2008-03-14 00:35:40.000000000 +0100
+++ egcc-SVN20080628/gcc/config/darwin-driver.c	2008-06-29 19:31:52.000000000 +0200
@@ -93,7 +93,7 @@ darwin_default_min_version (int * argc_p
 	&& macosx_deployment_target[0])
       {
 	++*argc_p;
-	*argv_p = xmalloc (sizeof (char *) * *argc_p);
+	*argv_p = XNEWVEC (char *, *argc_p);
 	(*argv_p)[0] = argv[0];
 	(*argv_p)[1] = concat ("-mmacosx-version-min=",
 			       macosx_deployment_target, NULL);
@@ -144,7 +144,7 @@ darwin_default_min_version (int * argc_p

   /* Add the new flag.  */
   ++*argc_p;
-  *argv_p = xmalloc (sizeof (char *) * *argc_p);
+  *argv_p = XNEWVEC (char *, *argc_p);
   (*argv_p)[0] = argv[0];
   (*argv_p)[1] = new_flag;
   memcpy (*argv_p + 2, argv + 1, (argc - 1) * sizeof (char *));


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]