Skip to content

Commit 89fe121

Browse files
Ramsay Jonesgitster
authored andcommitted
notes: Initialise variable to appease gcc
gcc version 3.4.4 thinks that the 'cmp' variable could be used while uninitialised and complains thus: notes.c: In function `write_each_non_note_until': notes.c:719: warning: 'cmp' might be used uninitialized in \ this function Note that gcc versions 4.1.2 and 4.4.0 do not issue this warning. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bbb1b8a commit 89fe121

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ static int write_each_non_note_until(const char *note_path,
716716
struct write_each_note_data *d)
717717
{
718718
struct non_note *n = d->next_non_note;
719-
int cmp, ret;
719+
int cmp = 0, ret;
720720
while (n && (!note_path || (cmp = strcmp(n->path, note_path)) <= 0)) {
721721
if (note_path && cmp == 0)
722722
; /* do nothing, prefer note to non-note */

0 commit comments

Comments
 (0)