Re: [PATCH] Remove various dead assignments and dead increments found by the clang static analyzer

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Reece Dunn
Date: Saturday, September 26, 2009 - 2:03 pm

2009/9/26 Jeff King <peff@peff.net>:

The status variable is removed in this patch.

But then shouldn't the status returned be checked and acted on? That
is, are failures from run_command_v_opt being reported to the user, or
otherwise reacted to?

In this case, IIUC, the status should be returned by the
run_update_post_hook function. I.e.:

-  static void run_update_post_hook(struct command *cmd)
+  static int run_update_post_hook(struct command *cmd)
  {
      struct command *cmd_p;
-     int argc, status;
+     int argc;
...
-     status = run_command_v_opt(argv, RUN_COMMAND_NO_STDIN
+     return run_command_v_opt(argv, RUN_COMMAND_NO_STDIN
                      | RUN_COMMAND_STDOUT_TO_STDERR);
   }

Thus having the same effect (removing the status variable). Callers of
run_update_post_hook should be checked as well, as should other
run_command_* calls.

- Reece
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Remove various dead assignments and dead increment ..., Giuseppe Scrivano, (Sat Sep 26, 7:46 am)
Re: [PATCH] Remove various dead assignments and dead incre ..., Johannes Schindelin, (Sat Sep 26, 8:58 am)
Re: [PATCH] Remove various dead assignments and dead incre ..., Giuseppe Scrivano, (Sat Sep 26, 11:21 am)
Re: [PATCH] Remove various dead assignments and dead incre ..., Sverre Rabbelier, (Sat Sep 26, 11:34 am)
Re: [PATCH] Remove various dead assignments and dead incre ..., Giuseppe Scrivano, (Sat Sep 26, 11:46 am)
Re: [PATCH] Remove various dead assignments and dead incre ..., Giuseppe Scrivano, (Sat Sep 26, 12:15 pm)
Re: [PATCH] Remove various dead assignments and dead incre ..., =?ISO-8859-1?Q?Ren=E ..., (Sat Sep 26, 12:28 pm)
Re: [PATCH] Remove various dead assignments and dead incre ..., Johannes Schindelin, (Sat Sep 26, 1:39 pm)
Re: [PATCH] Remove various dead assignments and dead incre ..., Reece Dunn, (Sat Sep 26, 2:03 pm)
Re: [PATCH] Remove various dead assignments and dead incre ..., Giuseppe Scrivano, (Sat Sep 26, 2:42 pm)
Re: [PATCH] Remove various dead assignments and dead incre ..., Giuseppe Scrivano, (Sun Sep 27, 1:21 am)