Compiling GNU gettext on CentOS 5 (gcc 4.1.2), I see this warning: gettext-tools/gnulib-lib/spawni.c:861: warning: ignoring #pragma GCC diagnostic [-Wunknown-pragmas]
This particular pragma is only supported without warning for gcc ≥ 4.2. 2023-06-05 Bruno Haible <[email protected]> posix_spawn-internal: Fix a warning (regression 2022-11-20). * lib/spawni.c: Don't use this particular #pragma for gcc < 4.2. diff --git a/lib/spawni.c b/lib/spawni.c index cc9511fdd8..84d1fb27f6 100644 --- a/lib/spawni.c +++ b/lib/spawni.c @@ -857,7 +857,7 @@ __spawni (pid_t *pid, const char *prog_filename, /* 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 +#if _GL_GNUC_PREREQ (4, 2) # pragma GCC diagnostic ignored "-Wdeprecated-declarations" #endif
