1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-02 22:16:11 +02:00

Fix some "variable might be used uninitialized" warnings

In particular, gcc complains as follows:

        CC tree-walk.o
    tree-walk.c: In function `traverse_trees':
    tree-walk.c:347: warning: 'e' might be used uninitialized in this \
        function

        CC builtin/revert.o
    builtin/revert.c: In function `verify_opt_mutually_compatible':
    builtin/revert.c:113: warning: 'opt2' might be used uninitialized in \
        this function

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Ramsay Jones 2011-09-11 20:39:32 +01:00 committed by Junio C Hamano
parent 16f5bfcf65
commit 27c0f76884
2 changed files with 2 additions and 2 deletions

View File

@ -110,7 +110,7 @@ static void verify_opt_compatible(const char *me, const char *base_opt, ...)
static void verify_opt_mutually_compatible(const char *me, ...)
{
const char *opt1, *opt2;
const char *opt1, *opt2 = NULL;
va_list ap;
va_start(ap, me);

View File

@ -344,7 +344,7 @@ int traverse_trees(int n, struct tree_desc *t, struct traverse_info *info)
unsigned long mask, dirmask;
const char *first = NULL;
int first_len = 0;
struct name_entry *e;
struct name_entry *e = NULL;
int len;
for (i = 0; i < n; i++) {