emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 51b14b1: Avoid compiler warnings with MinGW64 GCC 6


From: Eli Zaretskii
Subject: [Emacs-diffs] master 51b14b1: Avoid compiler warnings with MinGW64 GCC 6
Date: Thu, 1 Sep 2016 14:13:01 +0000 (UTC)

branch: master
commit 51b14b1f53bfb6c5c10288ab3a6c8c4a86fb70b9
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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.
---
 nt/inc/ms-w32.h |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h
index bb8ae6a..12cd081 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]