summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-09-01 17:12:12 +0300
committerEli Zaretskii <eliz@gnu.org>2016-09-01 17:12:12 +0300
commit51b14b1f53bfb6c5c10288ab3a6c8c4a86fb70b9 (patch)
tree99faa2668e778ed852c2a6611bc5f4ac9a9f8203
parent1d4bb91a3b8db3d381ca41230c8373ecc37438bc (diff)
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.
-rw-r--r--nt/inc/ms-w32.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index bb8ae6ad8f..12cd081005 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 <stdint.h> /* 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