dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: dev-VfR2kkLFssw@public.gmane.org
Subject: [PATCH] ethdev: fix empty struct rte_eth_txmode
Date: Wed, 12 Jun 2013 16:30:05 +0200	[thread overview]
Message-ID: <1371047405-29432-1-git-send-email-thomas.monjalon@6wind.com> (raw)
In-Reply-To: <201306121539.49552.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>

The previous fix was for g++ but is broken with gcc:
	error: flexible array member in otherwise empty struct
See http://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Zero-Length.html

Let's fix it with #ifdef __cplusplus.

Signed-off-by: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
---
 lib/librte_ether/rte_ethdev.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index a253b3f..2280772 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -320,7 +320,9 @@ struct rte_eth_vmdq_dcb_conf {
  * For future extensions.
  */
 struct rte_eth_txmode {
+#ifdef __cplusplus
 	int reserved[]; /* force size of struct to be 0 */
+#endif
 };
 
 /**
-- 
1.7.10.4

  parent reply	other threads:[~2013-06-12 14:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12 12:23 Can the empty struct rte_eth_txmode be enhanced? lxu
     [not found] ` <tencent_32A472FE12E181E41F4C6C1C-9uewiaClKEY@public.gmane.org>
2013-06-12 13:39   ` Thomas Monjalon
     [not found]     ` <201306121539.49552.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2013-06-12 14:30       ` Thomas Monjalon [this message]
     [not found]         ` <1371047405-29432-1-git-send-email-thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2013-06-12 14:46           ` [PATCH] ethdev: fix empty struct rte_eth_txmode Olivier MATZ
     [not found]             ` <51B889B2.9050105-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2013-06-12 15:14               ` 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=1371047405-29432-1-git-send-email-thomas.monjalon@6wind.com \
    --to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.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).