From 614ff64f8c5ddce71a53c7c7a34f048e7fad34fa Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 10 Nov 2008 12:48:32 +0100 Subject: [PATCH] Fix a serious gcc warning. --- ChangeLog | 4 ++++ lib/spawni.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5b88d5ba5..39792a6c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-11-10 Bruno Haible + * lib/spawni.c (__spawni): Force variable into the stack. + +2008-11-10 Bruno Haible + Add support for Haiku. * lib/fbufmode.c (fbufmode): Test a symbol that is not only defined on glibc and BeOS, but also on Haiku. diff --git a/lib/spawni.c b/lib/spawni.c index 0d0d418cb..ea6555333 100644 --- a/lib/spawni.c +++ b/lib/spawni.c @@ -133,6 +133,10 @@ __spawni (pid_t *pid, const char *file, /* Do this once. */ short int flags = attrp == NULL ? 0 : attrp->_flags; + /* Avoid gcc warning + "variable 'flags' might be clobbered by 'longjmp' or 'vfork'" */ + (void) &flags; + /* Generate the new process. */ #if HAVE_VFORK if ((flags & POSIX_SPAWN_USEVFORK) != 0 -- 2.11.0