OSDN Git Service

Circumvent <process.h> testsuite failure with GCC-7+.
authorKeith Marshall <keith@users.osdn.me>
Sun, 26 Aug 2018 19:40:38 +0000 (20:40 +0100)
committerKeith Marshall <keith@users.osdn.me>
Sun, 26 Aug 2018 19:40:38 +0000 (20:40 +0100)
mingwrt/ChangeLog
mingwrt/include/process.h

index fe327f1..9edae87 100644 (file)
@@ -1,3 +1,11 @@
+2018-08-26  Keith Marshall  <keith@users.osdn.me>
+
+       Circumvent <process.h> testsuite failure with GCC-7+.
+
+       * include/process.h (execv, execve, execvp): Subject declarations to
+       #pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch", if...
+       [__cplusplus && __IN_MINGWRT_TESTSUITE__ && __GNUC__ >= 7]: ...this.
+
 2018-04-16  Keith Marshall  <keith@users.osdn.me>
 
        Suppress glob-brace expansion within quoted arguments.
index aadbc89..ec37ae0 100644 (file)
@@ -189,6 +189,15 @@ intptr_t execlp (const char *, const char *, ...);
 _CRTIMP __cdecl __MINGW_NOTHROW
 intptr_t execlpe (const char *, const char *,...);
 
+#if defined __cplusplus && __IN_MINGWRT_TESTSUITE__ && __GNUC__ >= 7
+/* From GCC-7 onwards, with "-Wsystem-headers" enabled, the C++ compiler
+ * may emit unwanted "-Wbuiltin-declaration-mismatch" diagnostics related
+ * to the following "execv" function declarations; these will precipitate
+ * testsuite failures, so suppress them.
+ */
+# pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch"
+#endif
+
 _CRTIMP __cdecl __MINGW_NOTHROW
 intptr_t execv (const char *, const char * const *);
 
@@ -198,6 +207,12 @@ intptr_t execve (const char *, const char * const *, const char * const *);
 _CRTIMP __cdecl __MINGW_NOTHROW
 intptr_t execvp (const char *, const char * const *);
 
+#if defined __cplusplus && __IN_MINGWRT_TESTSUITE__ && __GNUC__ >= 7
+/* Re-enable previously suppressed "-Wbuiltin-declaration-mismatch" warnings.
+ */
+# pragma GCC diagnostic warning "-Wbuiltin-declaration-mismatch"
+#endif
+
 _CRTIMP __cdecl __MINGW_NOTHROW
 intptr_t execvpe (const char *, const char * const *, const char * const *);