bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #49938] fdin might be (but isn't?) clobbered by vfork


From: Martin Dorey
Subject: [bug #49938] fdin might be (but isn't?) clobbered by vfork
Date: Mon, 26 Dec 2016 18:42:50 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?49938>

                 Summary: fdin might be (but isn't?) clobbered by vfork
                 Project: make
            Submitted by: mdorey
            Submitted on: Mon 26 Dec 2016 10:42:49 AM PST
                Severity: 3 - Normal
              Item Group: Bug
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: SCM
        Operating System: POSIX-Based
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

I imagine it's gcc-4.7 giving me this:

job.c: In function ‘child_execute_job’:
job.c:2126:7: error: variable ‘fdin’ might be clobbered by ‘longjmp’
or ‘vfork’ [-Werror=clobbered]

... which goes away with this harmless-looking change:

address@hidden:~/download/make-git$ git diff
diff --git a/job.c b/job.c
index 7d900ce..1b28324 100644
--- a/job.c
+++ b/job.c
@@ -2123,7 +2123,7 @@ child_execute_job (struct output *out, int good_stdin,
char **argv, char **envp)
 {
   int r;
   int pid;
-  int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
+  const int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
   int fdout = FD_STDOUT;
   int fderr = FD_STDERR;
 





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49938>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]