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@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
This commit is contained in:
Andrew Cooper committed 2016-04-27 20:31:48 +01:00
1 parent ca4c1848f1
commit bec4135fdc
1 file changed
+1 -1
+1 -1
View File
@@ -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"
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.