Fix a serious gcc warning.
authorBruno Haible <bruno@clisp.org>
Mon, 10 Nov 2008 11:48:32 +0000 (12:48 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 10 Nov 2008 11:48:32 +0000 (12:48 +0100)
ChangeLog
lib/spawni.c

index 5b88d5b..39792a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2008-11-10  Bruno Haible  <bruno@clisp.org>
 
+       * lib/spawni.c (__spawni): Force variable into the stack.
+
+2008-11-10  Bruno Haible  <bruno@clisp.org>
+
        Add support for Haiku.
        * lib/fbufmode.c (fbufmode): Test a symbol that is not only defined on
        glibc and BeOS, but also on Haiku.
index 0d0d418..ea65553 100644 (file)
@@ -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