summaryrefslogtreecommitdiff
path: root/builtin/cat-file.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-03-21 11:10:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-21 21:06:38 (GMT)
commitcbfd5e1cbb539b82a34195efd0edde20d45a6439 (patch)
treee61d22ec111804500b0f6396269ac3e9008e3bd1 /builtin/cat-file.c
parent4db34cc134978012cf3f1b07de981a0418ed1523 (diff)
downloadgit-cbfd5e1cbb539b82a34195efd0edde20d45a6439.zip
git-cbfd5e1cbb539b82a34195efd0edde20d45a6439.tar.gz
git-cbfd5e1cbb539b82a34195efd0edde20d45a6439.tar.bz2
drop some obsolete "x = x" compiler warning hacks
In cases where the setting and access of a variable are protected by the same conditional flag, older versions of gcc would generate a "might be used unitialized" warning. We silence the warning by initializing the variable to itself, a hack that gcc recognizes. Modern versions of gcc are smart enough to get this right, going back to at least version 4.3.5. gcc 4.1 does get it wrong in both cases, but is sufficiently old that we probably don't need to care about it anymore. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/cat-file.c')
-rw-r--r--builtin/cat-file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 00528dd..ad29000 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -193,7 +193,7 @@ static int batch_one_object(const char *obj_name, int print_contents)
unsigned char sha1[20];
enum object_type type = 0;
unsigned long size;
- void *contents = contents;
+ void *contents;
if (!obj_name)
return 1;