From: Dongli Zhang Date: Wed, 15 Jun 2016 13:07:53 +0000 (+0800) Subject: tools/livepatch: initialise j to 0 to fix compilation error in gcc 4.5 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~916 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=87beb45e0b05be76755cac53322aae4f5b426aac;p=xen.git tools/livepatch: initialise j to 0 to fix compilation error in gcc 4.5 Initialise j to 0 to make some versions of gcc (e.g., gcc4.5/4.3) happy to avoid compilation error by commit beba3693f7243e68bbe31fe3794da91068eeea5b. Failure manifests with gcc 4.5 as: [ 153s] cc1: warnings being treated as errors [ 153s] xen-livepatch.c: In function 'main': [ 153s] xen-livepatch.c:415:12: error: 'j' may be used uninitialized in this function [ 153s] make[3]: *** [xen-livepatch.o] Error 1 Signed-off-by: Dongli Zhang Acked-by: Wei Liu --- diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c index 316248979c..62c072ec3a 100644 --- a/tools/misc/xen-livepatch.c +++ b/tools/misc/xen-livepatch.c @@ -412,7 +412,7 @@ struct { int main(int argc, char *argv[]) { - int i, j, ret; + int i, j = 0, ret; if ( argc <= 1 ) {