]> Savannah Git Hosting - gnulib.git/commitdiff
posix_spawn-internal: Avoid warning on macOS.
authorBruno Haible <bruno@clisp.org>
Sun, 20 Nov 2022 11:47:20 +0000 (12:47 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 20 Nov 2022 11:47:20 +0000 (12:47 +0100)
Suggested by Minsoo Choo in
<https://lists.gnu.org/archive/html/bug-gnulib/2022-11/msg00114.html>.

* lib/spawni.c: Ignore -Wdeprecated-declarations warnings.

ChangeLog
lib/spawni.c

index b0554ff5dae196576dae23ed1535883c95ea749c..08efc65917b5aedfcc4a8cb80ef728d237e3d058 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-11-20  Bruno Haible  <bruno@clisp.org>
+
+       posix_spawn-internal: Avoid warning on macOS.
+       Suggested by Minsoo Choo in
+       <https://lists.gnu.org/archive/html/bug-gnulib/2022-11/msg00114.html>.
+       * lib/spawni.c: Ignore -Wdeprecated-declarations warnings.
+
 2022-11-20  Bruno Haible  <bruno@clisp.org>
 
        posix_spawn tests: Fix compilation error (regression 2022-09-14).
index b3b3b56f31fa7506474e6707e761ce01f818712e..a5081fd45b37a472ac50cd4c951bf2b68d7c1609 100644 (file)
@@ -854,6 +854,13 @@ __spawni (pid_t *pid, const char *prog_filename,
 #else
 
 
+/* The warning "warning: 'vfork' is deprecated: Use posix_spawn or fork" seen
+   on macOS 12 is pointless, as we use vfork only when it is safe or when the
+   user has explicitly requested it.  Silence this warning.  */
+#if __GNUC__ >= 3
+# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
    Before running the process perform the actions described in FILE-ACTIONS. */
 int