From: "Wiles, Roger Keith" <keith.wiles@windriver.com>
To: "<dev@dpdk.org>" <dev@dpdk.org>
Subject: [dpdk-dev] Clang reporting a problem when adding another member initialization.
Date: Fri, 3 Oct 2014 21:05:36 +0000 [thread overview]
Message-ID: <C9B04192-49B9-4443-8554-2D35598F4F61@windriver.com> (raw)
I run into a problem with Clang report problem when I tried to add another member to the static initializer of the following in file ixgbe_rxtx_vec.c
int
ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq)
{
static struct rte_mbuf mb_def = {
.nb_segs = 1,
.data_off = RTE_PKTMBUF_HEADROOM,
.reserved2 = 0x5555,
#ifdef RTE_MBUF_REFCNT
{ .refcnt = 1, }
#endif
};
== Build lib/librte_pmd_ixgbe
CC ixgbe_rxtx_vec.o
/home/keithw/projects/dpdk-code/dpdk/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c:739:5: error: designator in initializer for scalar type 'uint16_t' (aka 'unsigned short')
{ .refcnt = 1, }
^~~~~~~~~~~
1 error generated.
I moved the ‘,’ in the { } to outside and still the same problem.
int
ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq)
{
static struct rte_mbuf mb_def = {
.nb_segs = 1,
.data_off = RTE_PKTMBUF_HEADROOM,
.reserverd2 = (uint16_t)0x5555,
#ifdef RTE_MBUF_REFCNT
{ .refcnt = 1 },
#endif
};
== Build lib/librte_pmd_ixgbe
CC ixgbe_rxtx_vec.o
/home/keithw/projects/dpdk-code/dpdk/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c:739:5: error: designator in initializer for scalar type 'uint16_t' (aka 'unsigned short')
{ .refcnt = 1 },
^~~~~~~~~~~
1 error generated.
Without adding the ‘.reserved2 = 0x5555,’ it builds.
int
ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq)
{
static struct rte_mbuf mb_def = {
.nb_segs = 1,
.data_off = RTE_PKTMBUF_HEADROOM,
.reserverd2 = (uint16_t)0x5555,
#ifdef RTE_MBUF_REFCNT
.refcnt = 1,
#endif
};
Then I removed the {} and it now builds. Is this a result of the changes to the mbuf structure and Clang being picky?
Should I submit a patch to remove the ‘{ }’ values?
Keith Wiles, Principal Technologist with CTO office, Wind River mobile 972-213-5533
next reply other threads:[~2014-10-03 20:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-03 21:05 Wiles, Roger Keith [this message]
2014-10-06 8:54 ` Thomas Monjalon
2014-10-06 14:55 ` Wiles, Roger Keith
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=C9B04192-49B9-4443-8554-2D35598F4F61@windriver.com \
--to=keith.wiles@windriver.com \
--cc=dev@dpdk.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).