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 5b88d5ba5d98cdf59dc1c3b89714e6c472cb59bb..39792a6c39d33437a95d0c56674abff94b31ca62 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+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.
index 0d0d418cb7f4b0529e95510abb5272bd7dcaea7d..ea6555333db0d816ca31a8dcc66bf6fa4ae93b7c 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