From: "Van Haaren, Harry" <harry.van.haaren@intel.com>
To: "Yang, Yi Y" <yi.y.yang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH v2] service: fix build error "ids uninitialized in rte_service_map_lcore_set"
Date: Thu, 21 Sep 2017 11:55:05 +0000 [thread overview]
Message-ID: <E923DB57A917B54B9182A2E928D00FA650FA8738@IRSMSX101.ger.corp.intel.com> (raw)
In-Reply-To: <1505958643-21203-1-git-send-email-yi.y.yang@intel.com>
> From: Yang, Yi Y
> Sent: Thursday, September 21, 2017 2:51 AM
> To: dev@dpdk.org
> Cc: Van Haaren, Harry <harry.van.haaren@intel.com>; Yang, Yi Y
> <yi.y.yang@intel.com>
> Subject: [PATCH v2] service: fix build error "ids uninitialized in
> rte_service_map_lcore_set"
>
> v1->v2
> - Change title to more descriptive one
> - Add issue reproduce information to git log body
>
> On current master tree, normal DPDK make will result in
> the below error:
>
> error: ‘ids[0]’ may be used uninitialized in this
> function [-Werror=maybe-uninitialized]
> ret = rte_service_map_lcore_set(i, ids[lcore_iter], 1);
>
> It can be reproduced very easily on Fedora 21 with
> gcc-4.9.2-6.fc21.x86_64.
>
> It is fixed after applied this patch.
>
> Signed-off-by: Yi Yang <yi.y.yang@intel.com>
+CC Thomas, please pull this asap, as it causes build issues on various GCC/OS versions.
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
> lib/librte_eal/common/rte_service.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/common/rte_service.c
> b/lib/librte_eal/common/rte_service.c
> index 43716bb..e598e16 100644
> --- a/lib/librte_eal/common/rte_service.c
> +++ b/lib/librte_eal/common/rte_service.c
> @@ -431,7 +431,7 @@ rte_service_start_with_defaults(void)
> uint32_t count = rte_service_get_count();
>
> int32_t lcore_iter = 0;
> - uint32_t ids[RTE_MAX_LCORE];
> + uint32_t ids[RTE_MAX_LCORE] = {0};
> int32_t lcore_count = rte_service_lcore_list(ids, RTE_MAX_LCORE);
>
> if (lcore_count == 0)
> --
> 2.1.0
next prev parent reply other threads:[~2017-09-21 11:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 1:50 Yi Yang
2017-09-21 11:55 ` Van Haaren, Harry [this message]
2017-09-21 12:41 ` Thomas Monjalon
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=E923DB57A917B54B9182A2E928D00FA650FA8738@IRSMSX101.ger.corp.intel.com \
--to=harry.van.haaren@intel.com \
--cc=dev@dpdk.org \
--cc=thomas@monjalon.net \
--cc=yi.y.yang@intel.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;
as well as URLs for NNTP newsgroup(s).