git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Giuseppe Scrivano <gscrivano@gnu.org>
Date
Sep 26, 2009, 21:42 UTC
Message-ID
<87bpkxcrhy.fsf@master.homenet>
In-Reply-To
<3f4fd2640909261420h2588df4cld8dd3e49f9654e9e@mail.gmail.com>
Reece Dunn <msclrhd@googlemail.com> writes:
>> There is exactly one caller, and it doesn't care about the return code
>> for the reasons mentioned above.
>
> Including being called from a script?

I agree, if something goes wrong then it should be reported. The same applies to the `run_receive_hook' return code that is not checked in `cmd_receive_pack'.

Considering you want to keep the current source code invariants, and I don't have any objection to it, probably the only assignment that can be removed is the following one:

>From f8dd14bf4c3f3e132f6a8e13bf3e2fc575a804b1 Mon Sep 17 00:00:00 2001
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sat, 26 Sep 2009 23:23:13 +0200
Subject: [PATCH] Remove a dead assignment found by the clang static analyzer
---
 http-fetch.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/http-fetch.c b/http-fetch.c
index e8f44ba..6879904 100644
--- a/http-fetch.c
+++ b/http-fetch.c
@@ -3,7 +3,6 @@
 
 int main(int argc, const char **argv)
 {
-	const char *prefix;
 	struct walker *walker;
 	int commits_on_stdin = 0;
 	int commits;
@@ -19,7 +18,7 @@ int main(int argc, const char **argv)
 	int get_verbosely = 0;
 	int get_recover = 0;
 
-	prefix = setup_git_directory();
+	setup_git_directory();
 
 	git_config(git_default_config, NULL);
 
-- 
1.6.3.3
Previous: Reece DunnNext: Nicolas Pitre
Message 15 of 17 in “Remove various dead assignments and dead increments found by the clang static analyzer”
  1. Remove various dead assignments and dead increments found by the clang static analyzerGiuseppe Scrivano, Sep 26, 2009
  2. Johannes SchindelinSep 26, 2009
  3. Giuseppe ScrivanoSep 26, 2009
  4. Sverre RabbelierSep 26, 2009
  5. Giuseppe ScrivanoSep 26, 2009
  6. Giuseppe ScrivanoSep 26, 2009
  7. René ScharfeSep 26, 2009
  8. Johannes SchindelinSep 26, 2009
  9. Jeff KingSep 26, 2009
  10. Reece DunnSep 26, 2009
  11. Jeff KingSep 26, 2009
  12. Reece DunnSep 26, 2009
  13. Jeff KingSep 26, 2009
  14. Reece DunnSep 26, 2009
  15. Giuseppe ScrivanoSep 26, 2009
  16. Nicolas PitreSep 27, 2009
  17. Giuseppe ScrivanoSep 27, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.