This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH]: Fix PR bootstrap/36664 -Wc++-compat failure on darwin
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dominiq at lps dot ens dot fr
- Date: Sun, 29 Jun 2008 13:42:44 -0400 (EDT)
- Subject: [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 *));