Skip to content

Commit 0a34594

Browse files
Ramsay Jonesgitster
authored andcommitted
fast-import: Fix an gcc -Wuninitialized warning
Commit cbfd5e1 ("drop some obsolete "x = x" compiler warning hacks", 21-03-2013) removed a gcc hack that suppressed an "might be used uninitialized" warning issued by older versions of gcc. However, commit 3aa99df ('fast-import: clarify "inline" logic in file_change_m', 21-03-2013) addresses an (almost) identical issue (with very similar code), but includes additional code in it's resolution. The solution used by this commit, unlike that used by commit cbfd5e1, also suppresses the -Wuninitialized warning on older versions of gcc. In order to suppress the warning (against the 'oe' symbol) in the note_change_n() function, we adopt the same solution used by commit 3aa99df. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5e950c2 commit 0a34594

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fast-import.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2465,6 +2465,7 @@ static void note_change_n(struct branch *b, unsigned char *old_fanout)
24652465
hashcpy(sha1, oe->idx.sha1);
24662466
} else if (!prefixcmp(p, "inline ")) {
24672467
inline_data = 1;
2468+
oe = NULL; /* not used with inline_data, but makes gcc happy */
24682469
p += strlen("inline"); /* advance to space */
24692470
} else {
24702471
if (get_sha1_hex(p, sha1))

0 commit comments

Comments
 (0)