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]

Re: [PATCH] Silence execvp argv warning in gcc.c on MinGW


Aaron W. LaFramboise wrote:
Richard Guenther wrote:
On Sun, Aug 17, 2008 at 8:01 AM, Aaron W. LaFramboise
<aaronavay62@aaronwl.com> wrote:

Annoyingly, Microsoft's prototype for execvp() differs from POSIX; the
mingw-runtime headers are also different in this same way.

OK, I messed this up a second time. The attached patch is the one that actually works to silence this warning.


Is this OK to commit?

I'd be open to any alternatives if this uglification is not OK. I'm honestly not sure why there's an execvp() call in gcc.c at all, rather than using libiberty pexecute.
2008-08-17  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>

	* gcc.c [MINGW32] (process_command): Cast execvp argv.

Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c	(revision 138863)
+++ gcc/gcc.c	(working copy)
@@ -3423,7 +3423,11 @@ process_command (int argc, const char **
       new_argv = XDUPVEC (char *, argv, argc + 1);
       new_argv[0] = new_argv0;
 
+#ifdef __MINGW32__
+      execvp (new_argv0, (const char *const *)new_argv);
+#else
       execvp (new_argv0, new_argv);
+#endif
       fatal ("couldn't run '%s': %s", new_argv0, xstrerror (errno));
     }
 

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