xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH for-4.7 5/7] tools/kdd: Fix uninitialised variable warning
Date: Wed, 27 Apr 2016 19:01:00 +0100	[thread overview]
Message-ID: <20160427180100.GF29719@citrix.com> (raw)
In-Reply-To: <1461776486-31484-6-git-send-email-andrew.cooper3@citrix.com>

On Wed, Apr 27, 2016 at 06:01:24PM +0100, Andrew Cooper wrote:
> 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>

> ---
> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
> CC: Wei Liu <wei.liu2@citrix.com>
> ---
>  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"
> -- 
> 2.1.4
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-04-27 18:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 17:01 [PATCH for-4.7 0/7] More tools build fixes with clang Andrew Cooper
2016-04-27 17:01 ` [PATCH for-4.7 1/7] tools/xenstat: Avoid comparing '0 <= unsigned integer' Andrew Cooper
2016-04-27 18:00   ` Wei Liu
2016-04-27 19:18   ` Doug Goldstein
2016-04-27 17:01 ` [PATCH for-4.7 2/7] tools/blktap2: Use abort() instead of custom crash Andrew Cooper
2016-04-27 18:00   ` Wei Liu
2016-04-27 19:17   ` Doug Goldstein
2016-04-27 17:01 ` [PATCH for-4.7 3/7] tools/blktap2: Fix array initialisers for tapdisk_disk_{types, drivers}[] Andrew Cooper
2016-04-27 18:00   ` Wei Liu
2016-04-27 19:16   ` Doug Goldstein
2016-04-27 17:01 ` [PATCH for-4.7 4/7] tools/blktap2: Fix use of uninitialised variable in _tap_list_join3() Andrew Cooper
2016-04-27 18:00   ` Wei Liu
2016-04-27 19:16   ` Doug Goldstein
2016-04-27 17:01 ` [PATCH for-4.7 5/7] tools/kdd: Fix uninitialised variable warning Andrew Cooper
2016-04-27 18:01   ` Wei Liu [this message]
2016-04-27 19:15   ` Doug Goldstein
2016-04-27 17:01 ` [PATCH for-4.7 6/7] travis: Remove clang-3.8 build Andrew Cooper
2016-04-27 18:02   ` Wei Liu
2016-04-27 19:13   ` Doug Goldstein
2016-04-27 17:01 ` [PATCH for-4.7 7/7] travis: Enable tools when building with clang Andrew Cooper
2016-04-27 18:03   ` Wei Liu
2016-04-27 19:14   ` Doug Goldstein
2016-04-27 18:04 ` [PATCH for-4.7 0/7] More tools build fixes " Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160427180100.GF29719@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).