@matheusbsbs / matheus-bagliano / commits / 89fe121d5f
Fork 0

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 <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramsay Jones committed Jun 21, 2010 at 19:52 UTC 89fe121d5fd808391ee38b7f39b88cb3f912776f
1 file changed +1 -1
notes.c
+1 -1
@@ -716,7 +716,7 @@ static int write_each_non_note_until(const char *note_path,
716 struct write_each_note_data *d)
717 {
718 struct non_note *n = d->next_non_note;
719 - int cmp, ret;
719 + int cmp = 0, ret;
720 while (n && (!note_path || (cmp = strcmp(n->path, note_path)) <= 0)) {
721 if (note_path && cmp == 0)
722 ; /* do nothing, prefer note to non-note */