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
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Sep 26, 2009, 15:58 UTC
Message-ID
<alpine.DEB.1.00.0909261756510.4985@pacific.mpi-cbg.de>
In-Reply-To
<87ab0hepcn.fsf@master.homenet>
Hi,
On Sat, 26 Sep 2009, Giuseppe Scrivano wrote:
Show 15 quoted lines
> I tried the clang static analyzer on the git source code, this patch
> fixes the found dead assignments/increments.
> 
> diff --git a/archive.c b/archive.c
> index 73b8e8a..88feed7 100644
> --- a/archive.c
> +++ b/archive.c
> @@ -357,7 +357,7 @@ int write_archive(int argc, const char **argv, const char *prefix,
>  	const struct archiver *ar = NULL;
>  	struct archiver_args args;
>  
> -	argc = parse_archive_args(argc, argv, &ar, &args);
> +	parse_archive_args(argc, argv, &ar, &args);
>  	if (setup_prefix && prefix == NULL)
>  		prefix = setup_git_directory();

I understand that clang complains when argc is not really used afterwards, but do we really want to do this? I mean, if somebody decides it'd be a good idea to check the number of arguments after parsing the arguments, they might be bitten by the fact that it is now actively wrong.

Ciao, Dscho

Previous: Giuseppe ScrivanoNext: Giuseppe Scrivano
Message 2 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.