public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2] ip-link: remove warning message
Date: Tue, 2 Feb 2016 15:56:51 +1100	[thread overview]
Message-ID: <20160202155651.08800af5@samsung9> (raw)
In-Reply-To: <1453343029-14580-1-git-send-email-zhangshengju@cmss.chinamobile.com>

On Thu, 21 Jan 2016 02:23:49 +0000
Zhang Shengju <zhangshengju@cmss.chinamobile.com> wrote:

> the warning was:
> iproute.c:301:12: warning: 'val' may be used uninitialized in this
> function [-Wmaybe-uninitialized]
>    features &= ~RTAX_FEATURE_ECN;
>             ^
> iproute.c:575:10: note: 'val' was declared here
>    __u32 val;
> 	  ^
> 
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> ---
>  ip/iproute.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ip/iproute.c b/ip/iproute.c
> index d5e3ebe..afe70e1 100644
> --- a/ip/iproute.c
> +++ b/ip/iproute.c
> @@ -572,7 +572,7 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
>  			mxlock = *(unsigned*)RTA_DATA(mxrta[RTAX_LOCK]);
>  
>  		for (i=2; i<= RTAX_MAX; i++) {
> -			__u32 val;
> +			__u32 val = 0U;
>  
>  			if (mxrta[i] == NULL)
>  				continue;

Your compiler is doing bad dependency analysis.
There is not really a bug here.

It would still be best to initialize to keep broken compilers from causing warning.

      reply	other threads:[~2016-02-02  4:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21  2:23 [PATCH iproute2] ip-link: remove warning message Zhang Shengju
2016-02-02  4:56 ` Stephen Hemminger [this message]

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=20160202155651.08800af5@samsung9 \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=zhangshengju@cmss.chinamobile.com \
    /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