DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [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@6wind.com>

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@6wind.com>
---
 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

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

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-12 12:23 [dpdk-dev] Can the empty struct rte_eth_txmode be enhanced? lxu
2013-06-12 13:39 ` Thomas Monjalon
2013-06-12 14:30   ` Thomas Monjalon [this message]
2013-06-12 14:46     ` [dpdk-dev] [PATCH] ethdev: fix empty struct rte_eth_txmode Olivier MATZ
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@6wind.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).