Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

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

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:47:27

Hi,

On Sat, 26 Sep 2009, Giuseppe Scrivano wrote:
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help