From: Eli Zaretskii Date: Thu, 1 Sep 2016 14:12:12 +0000 (+0300) Subject: Avoid compiler warnings with MinGW64 GCC 6 X-Git-Tag: emacs-26.0.90~1660 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=51b14b1f53bfb6c5c10288ab3a6c8c4a86fb70b9;p=emacs.git Avoid compiler warnings with MinGW64 GCC 6 * nt/inc/ms-w32.h (execve) [MINGW_W64]: Make the prototype match the GCC 6 builtin, to avoid warnings. For more details, see http://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00721.html. --- diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index bb8ae6ad8f9..12cd0810054 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -293,7 +293,16 @@ extern int sys_umask (int); #define execvp _execvp #include /* for intptr_t */ extern intptr_t _execvp (const char *, char **); +#ifdef MINGW_W64 +/* MinGW64 GCC 6 has a builtin execve with the prototype shown below. + The return value is wrong, and is a bug in GCC, but using the + correct prototype causes GCC to emit warnings. Fortunately, execve + is not used in the MinGW build, but the code that references it is + still compiled. */ +extern int execve (const char *, char * const *, char * const *); +#else extern intptr_t execve (const char *, char * const *, char * const *); +#endif #define fdatasync _commit #define fdopen _fdopen #define fsync _commit