DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Clang reporting a problem when adding another member initialization.
@ 2014-10-03 21:05 Wiles, Roger Keith
       [not found] ` <C9B04192-49B9-4443-8554-2D35598F4F61-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Wiles, Roger Keith @ 2014-10-03 21:05 UTC (permalink / raw)
  To: <dev-VfR2kkLFssw@public.gmane.org>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-10-06 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-03 21:05 Clang reporting a problem when adding another member initialization Wiles, Roger Keith
     [not found] ` <C9B04192-49B9-4443-8554-2D35598F4F61-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org>
2014-10-06  8:54   ` Thomas Monjalon
2014-10-06 14:55     ` Wiles, Roger Keith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox