DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org, ssujith@cisco.com
Subject: [dpdk-dev] [PATCH 1/2] enic: fix initialization error with clang
Date: Fri,  5 Dec 2014 15:57:11 +0000	[thread overview]
Message-ID: <1417795032-23524-2-git-send-email-bruce.richardson@intel.com> (raw)
In-Reply-To: <1417795032-23524-1-git-send-email-bruce.richardson@intel.com>

This patch fixes the following compiler error raised by clang 3.3
on FreeBSD 10:

  CC enic_clsf.o
/usr/home/bruce/dpdk.org/lib/librte_pmd_enic/enic_clsf.c:99:25: fatal error: missing field 'u' initializer [-Wmissing-field-initializers]
        struct filter fltr = {0};

It fixes it by changing the initializer to set a named field to zero,
thereby automatically setting the rest of the unnamed fields also to
zero.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_pmd_enic/enic_clsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_pmd_enic/enic_clsf.c b/lib/librte_pmd_enic/enic_clsf.c
index 30a4def..577a382 100644
--- a/lib/librte_pmd_enic/enic_clsf.c
+++ b/lib/librte_pmd_enic/enic_clsf.c
@@ -96,7 +96,7 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_fdir_filter *params,
 	u16 queue, u8 drop)
 {
 	struct enic_fdir_node *key;
-	struct filter fltr = {0};
+	struct filter fltr = {.type = 0};
 	int32_t pos;
 	u8 do_free = 0;
 	u16 old_fltr_id = 0;
-- 
2.1.0

  reply	other threads:[~2014-12-05 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-05 15:57 [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation Bruce Richardson
2014-12-05 15:57 ` Bruce Richardson [this message]
2014-12-05 15:57 ` [dpdk-dev] [PATCH 2/2] enic: fix error with uninitialized variable Bruce Richardson
2014-12-05 21:11 ` [dpdk-dev] [PATCH 0/2] enic fixes for clang compilation Thomas Monjalon
2014-12-07 15:21 ` Sujith Sankar (ssujith)

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=1417795032-23524-2-git-send-email-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ssujith@cisco.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).