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

[Xen-changelog] [xen master] tools/kdd: Fix uninitialised variable warning



commit bec4135fdca2538263abb1b552ec2c69539b04c2
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Wed Apr 27 13:58:27 2016 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Wed Apr 27 20:31:48 2016 +0100

    tools/kdd: Fix uninitialised variable warning
    
    Clang warns:
    
      kdd.c:1031:9: error: variable 'fd' is used uninitialized whenever '||'
      condition is true [-Werror,-Wsometimes-uninitialized]
          if (argc != 4
              ^~~~~~~~~
      kdd.c:1040:20: note: uninitialized use occurs here
          if (select(fd + 1, &fds, NULL, NULL, NULL) > 0)
                     ^~
    
    This situation can't actually happen, as usage() is a terminal path.  
Annotate
    it appropriately.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Reviewed-by: Doug Goldstein <cardoe@xxxxxxxxxx>
---
 tools/debugger/kdd/kdd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/debugger/kdd/kdd.c b/tools/debugger/kdd/kdd.c
index 9a0225b..70f007e 100644
--- a/tools/debugger/kdd/kdd.c
+++ b/tools/debugger/kdd/kdd.c
@@ -998,7 +998,7 @@ void kdd_select_callback(kdd_state *s)
 }
 
 
-static void usage(void)
+static void __attribute__((noreturn)) usage(void)
 {
     fprintf(stderr, 
 " usage: kdd [-v] <domid> <address> <port>\n"
--
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®.