[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] tools/livepatch: initialise j to 0 to fix compilation error in gcc 4.5



commit 87beb45e0b05be76755cac53322aae4f5b426aac
Author:     Dongli Zhang <dongli.zhang@xxxxxxxxxx>
AuthorDate: Wed Jun 15 21:07:53 2016 +0800
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Fri Jun 17 11:27:21 2016 +0100

    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 <dongli.zhang@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/misc/xen-livepatch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/misc/xen-livepatch.c b/tools/misc/xen-livepatch.c
index 3162489..62c072e 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 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.