OSDN Git Service

Improve testsuite diagnostic message handling.
authorKeith Marshall <keith@users.osdn.me>
Mon, 26 Jun 2023 21:30:16 +0000 (22:30 +0100)
committerKeith Marshall <keith@users.osdn.me>
Mon, 26 Jun 2023 21:30:16 +0000 (22:30 +0100)
mingwrt/ChangeLog
mingwrt/include/process.h

index 737ab3b..e06e128 100644 (file)
@@ -1,3 +1,14 @@
+2023-06-26  Keith Marshall  <keith@users.osdn.me>
+
+       Improve testsuite diagnostic message handling.
+
+       * include/process.h [__IN_MINGWRT_TESTSUITE__ && __GNUC__ >= 7]: Push
+       diagnostic state, to save the initial setting of, and then ignore...
+       (-Wbuiltin-declaration-mismatch): ...this, prior to declarations of...
+       (execv, execve, execvp): ...these functions; after these declarations,
+       pop the saved diagnostic state, to revert to the original condition,
+       rather than simply, and arbitrarily, enabling the warning.
+
 2022-08-26  Keith Marshall  <keith@users.osdn.me>
 
        Do not expose private declarations in <search.h>
index ddca50a..6585d82 100644 (file)
@@ -6,7 +6,7 @@
  * $Id$
  *
  * Written by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
- * Copyright (C) 1997-2001, 2003-2004, 2007-2008, 2016, 2022,
+ * Copyright (C) 1997-2001, 2003-2004, 2007-2008, 2016, 2022, 2023,
  *  MinGW.OSDN Project
  *
  *
@@ -196,6 +196,7 @@ intptr_t execlpe (const char *, const char *,...);
  * the following "execv" function declarations; these will precipitate
  * testsuite failures, so suppress them.
  */
+# pragma GCC diagnostic push
 # if __GNUC__ >= 9 || defined __cplusplus
   /* Prior to GCC-9, this limitation was apparent in the C++ compiler
    * only; it became apparent in the C compiler, from GCC-9.
@@ -213,10 +214,10 @@ 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
+#if __IN_MINGWRT_TESTSUITE__ && __GNUC__ >= 7
 /* Re-enable previously suppressed "-Wbuiltin-declaration-mismatch" warnings.
  */
-# pragma GCC diagnostic warning "-Wbuiltin-declaration-mismatch"
+# pragma GCC diagnostic pop
 #endif
 
 _CRTIMP __cdecl __MINGW_NOTHROW