From: Bruno Haible Date: Sun, 20 Nov 2022 11:47:20 +0000 (+0100) Subject: posix_spawn-internal: Avoid warning on macOS. X-Git-Tag: v1.0~1961 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=6ec9bc73686fd42d0a1a82c914d89176745cddbd;p=gnulib.git posix_spawn-internal: Avoid warning on macOS. Suggested by Minsoo Choo in . * lib/spawni.c: Ignore -Wdeprecated-declarations warnings. --- diff --git a/ChangeLog b/ChangeLog index b0554ff5da..08efc65917 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-11-20 Bruno Haible + + posix_spawn-internal: Avoid warning on macOS. + Suggested by Minsoo Choo in + . + * lib/spawni.c: Ignore -Wdeprecated-declarations warnings. + 2022-11-20 Bruno Haible posix_spawn tests: Fix compilation error (regression 2022-09-14). diff --git a/lib/spawni.c b/lib/spawni.c index b3b3b56f31..a5081fd45b 100644 --- a/lib/spawni.c +++ b/lib/spawni.c @@ -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