DPDK patches and discussions
 help / color / mirror / Atom feed
From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Thomas Monjalon <thomas.monjalon@6wind.com>
Subject: [dpdk-dev] [PATCH 04/10] lib: add extension keyword to nonstandard bit-fields
Date: Tue,  5 Apr 2016 16:08:04 +0200	[thread overview]
Message-ID: <1459865290-10248-5-git-send-email-adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <1459865290-10248-1-git-send-email-adrien.mazarguil@6wind.com>

Exported header files used by applications should allow the strictest
compiler flags. Language extensions used in many places must be explicitly
marked or removed to avoid warnings and compilation failures.

This commit prevents the following errors:

 error: type of bit-field `[...]' is a GCC extension

Note: the standard does not require implementations to issue a diagnostic
message with these, and such errors do not occur with recent GCC or clang
versions. However, GCC 4.7 is still common and using the extension keyword
is easier than checking compiler version.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 lib/librte_cryptodev/rte_cryptodev.h | 2 ++
 lib/librte_ether/rte_ethdev.h        | 4 ++++
 lib/librte_lpm/rte_lpm.h             | 4 ++++
 lib/librte_mbuf/rte_mbuf.h           | 1 +
 4 files changed, 11 insertions(+)

diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h
index ba6042d..bea48bb 100644
--- a/lib/librte_cryptodev/rte_cryptodev.h
+++ b/lib/librte_cryptodev/rte_cryptodev.h
@@ -706,6 +706,7 @@ struct rte_cryptodev {
 	struct rte_cryptodev_cb_list link_intr_cbs;
 	/**< User application callback for interrupts if present */
 
+	__extension__
 	uint8_t attached : 1;
 	/**< Flag indicating the device is attached */
 } __rte_cache_aligned;
@@ -729,6 +730,7 @@ struct rte_cryptodev_data {
 	char name[RTE_CRYPTODEV_NAME_MAX_LEN];
 	/**< Unique identifier name */
 
+	__extension__
 	uint8_t dev_started : 1;
 	/**< Device state: STARTED(1)/STOPPED(0) */
 
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 37ddd51..d002ba6 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -281,6 +281,7 @@ struct rte_eth_stats {
 /**
  * A structure used to retrieve link-level information of an Ethernet port.
  */
+__extension__
 struct rte_eth_link {
 	uint32_t link_speed;        /**< ETH_SPEED_NUM_ */
 	uint16_t link_duplex  : 1;  /**< ETH_LINK_[HALF/FULL]_DUPLEX */
@@ -372,6 +373,7 @@ struct rte_eth_rxmode {
 	enum rte_eth_rx_mq_mode mq_mode;
 	uint32_t max_rx_pkt_len;  /**< Only used if jumbo_frame enabled. */
 	uint16_t split_hdr_size;  /**< hdr buf size (header_split enabled).*/
+	__extension__
 	uint16_t header_split : 1, /**< Header Split enable. */
 		hw_ip_checksum   : 1, /**< IP/UDP/TCP checksum offload enable. */
 		hw_vlan_filter   : 1, /**< VLAN filter enable. */
@@ -656,6 +658,7 @@ struct rte_eth_txmode {
 
 	/* For i40e specifically */
 	uint16_t pvid;
+	__extension__
 	uint8_t hw_vlan_reject_tagged : 1,
 		/**< If set, reject sending out tagged pkts */
 		hw_vlan_reject_untagged : 1,
@@ -1688,6 +1691,7 @@ struct rte_eth_dev_data {
 	struct ether_addr* hash_mac_addrs;
 	/** Device Ethernet MAC addresses of hash filtering. */
 	uint8_t port_id;           /**< Device [external] port identifier. */
+	__extension__
 	uint8_t promiscuous   : 1, /**< RX promiscuous mode ON(1) / OFF(0). */
 		scattered_rx : 1,  /**< RX of scattered packets is ON(1) / OFF(0) */
 		all_multicast : 1, /**< RX all multicast mode ON(1) / OFF(0). */
diff --git a/lib/librte_lpm/rte_lpm.h b/lib/librte_lpm/rte_lpm.h
index 4397f5d..4ea6bf6 100644
--- a/lib/librte_lpm/rte_lpm.h
+++ b/lib/librte_lpm/rte_lpm.h
@@ -93,6 +93,7 @@ extern "C" {
 
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
 /** @internal Tbl24 entry structure. */
+__extension__
 struct rte_lpm_tbl_entry_v20 {
 	/**
 	 * Stores Next hop (tbl8 or tbl24 when valid_group is not set) or
@@ -116,6 +117,7 @@ struct rte_lpm_tbl_entry_v20 {
 	uint8_t depth       :6; /**< Rule depth. */
 };
 
+__extension__
 struct rte_lpm_tbl_entry {
 	/**
 	 * Stores Next hop (tbl8 or tbl24 when valid_group is not set) or
@@ -137,6 +139,7 @@ struct rte_lpm_tbl_entry {
 };
 
 #else
+__extension__
 struct rte_lpm_tbl_entry_v20 {
 	uint8_t depth       :6;
 	uint8_t valid_group :1;
@@ -147,6 +150,7 @@ struct rte_lpm_tbl_entry_v20 {
 	};
 };
 
+__extension__
 struct rte_lpm_tbl_entry {
 	uint32_t depth       :6;
 	uint32_t valid_group :1;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index bad349a..81eb3e4 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -827,6 +827,7 @@ struct rte_mbuf {
 	/* fields to support TX offloads */
 	union {
 		uint64_t tx_offload;       /**< combined for easy fetch */
+		__extension__
 		struct {
 			uint64_t l2_len:7; /**< L2 (MAC) Header Length. */
 			uint64_t l3_len:9; /**< L3 (IP) Header Length. */
-- 
2.1.4

  parent reply	other threads:[~2016-04-05 14:08 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 14:08 [dpdk-dev] [PATCH 00/10] Fix build errors related to exported headers Adrien Mazarguil
2016-04-05 14:08 ` [dpdk-dev] [PATCH 01/10] lib: add extension keyword to braced-groups within expressions Adrien Mazarguil
2016-04-05 14:08 ` [dpdk-dev] [PATCH 02/10] lib: add extension keyword to large enum values Adrien Mazarguil
2016-04-05 14:08 ` [dpdk-dev] [PATCH 03/10] lib: use C99 syntax for zero-size arrays Adrien Mazarguil
2016-04-05 14:08 ` Adrien Mazarguil [this message]
2016-04-05 14:08 ` [dpdk-dev] [PATCH 05/10] lib: add extension keyword to structs with no members Adrien Mazarguil
2016-04-05 14:08 ` [dpdk-dev] [PATCH 06/10] lib: add extension keyword to unnamed structs/unions Adrien Mazarguil
2016-04-05 14:08 ` [dpdk-dev] [PATCH 07/10] lib: fix missing include dependencies Adrien Mazarguil
2016-04-05 20:23   ` [dpdk-dev] [dpdk-dev, " Jan Viktorin
2016-04-06  8:54     ` Adrien Mazarguil
2016-04-06 12:10       ` Jan Viktorin
2016-04-05 14:08 ` [dpdk-dev] [PATCH 08/10] lib: add extension keyword to forward reference to enum types Adrien Mazarguil
2016-04-05 14:08 ` [dpdk-dev] [PATCH 09/10] lib: remove named variadic macros in exported headers Adrien Mazarguil
2016-04-05 14:08 ` [dpdk-dev] [PATCH 10/10] lib: hide static functions that are never defined Adrien Mazarguil
2016-07-05 10:44 ` [dpdk-dev] [PATCH v2 00/11] Fix build errors related to exported headers Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 01/11] lib: work around braced-groups within expressions Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 02/11] lib: work around large enum values Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 03/11] lib: use C99 syntax for zero-size arrays Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 04/11] lib: work around nonstandard bit-fields Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 05/11] lib: work around structs with no members Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 06/11] lib: work around unnamed structs/unions Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 07/11] lib: add missing include dependencies Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 08/11] lib: work around forward reference to enum types Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 09/11] lib: remove named variadic macros in exported headers Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 10/11] lib: hide static functions never defined Adrien Mazarguil
2016-07-05 10:44   ` [dpdk-dev] [PATCH v2 11/11] scripts: check compilation of exported header files Adrien Mazarguil
2016-07-05 11:15   ` [dpdk-dev] [PATCH v2 00/11] Fix build errors related to exported headers Jan Viktorin
2016-07-05 11:35     ` Adrien Mazarguil
2016-07-05 11:27   ` Ferruh Yigit
2016-07-05 12:33     ` Thomas Monjalon
2016-07-05 12:37     ` Adrien Mazarguil
2016-07-06 16:34   ` Thomas Monjalon
2016-07-07 15:49   ` [dpdk-dev] [PATCH v3 " Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 01/11] lib: work around braced-groups within expressions Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 02/11] lib: work around large enum values Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 03/11] lib: use C99 syntax for zero-size arrays Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 04/11] lib: work around nonstandard bit-fields Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 05/11] lib: work around structs with no members Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 06/11] lib: work around unnamed structs/unions Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 07/11] lib: add missing include dependencies Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 08/11] lib: work around forward reference to enum types Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 09/11] lib: remove named variadic macros in exported headers Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 10/11] lib: hide static functions never defined Adrien Mazarguil
2016-07-07 15:49     ` [dpdk-dev] [PATCH v3 11/11] scripts: check compilation of exported header files Adrien Mazarguil
2016-07-07 18:33     ` [dpdk-dev] [PATCH v3 00/11] Fix build errors related to exported headers Wiles, Keith
2016-07-08  8:05       ` Adrien Mazarguil
2016-07-08  9:56         ` Ferruh Yigit
2016-07-08 14:15           ` Wiles, Keith
2016-07-08 14:35             ` Adrien Mazarguil
2016-07-08 14:45               ` Ferruh Yigit
2016-07-08 15:23                 ` Adrien Mazarguil
2016-07-13 13:02     ` [dpdk-dev] [PATCH v4 00/10] " Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 01/10] lib: work around braced-groups within expressions Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 02/10] lib: work around large enum values Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 03/10] lib: use C99 syntax for zero-size arrays Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 04/10] lib: work around nonstandard bit-fields Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 05/10] lib: work around unnamed structs/unions Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 06/10] lib: add missing include dependencies Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 07/10] lib: work around forward reference to enum types Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 08/10] lib: remove named variadic macros in exported headers Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 09/10] lib: hide static functions never defined Adrien Mazarguil
2016-07-13 13:02       ` [dpdk-dev] [PATCH v4 10/10] scripts: check compilation of exported header files Adrien Mazarguil
2016-07-15 21:03       ` [dpdk-dev] [PATCH v4 00/10] Fix build errors related to exported headers Bruce Richardson
2016-07-18 10:47         ` Adrien Mazarguil
2016-07-20  9:55         ` Thomas Monjalon
2016-08-23 16:36       ` Thomas Monjalon
2016-09-08 12:39         ` Adrien Mazarguil
2016-09-08 12:25       ` [dpdk-dev] [PATCH v5 " Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 01/10] lib: work around braced-groups within expressions Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 02/10] lib: work around large enum values Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 03/10] lib: use C99 syntax for zero-size arrays Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 04/10] lib: work around nonstandard bit-fields Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 05/10] lib: work around unnamed structs/unions Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 06/10] lib: add missing include dependencies Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 07/10] lib: work around forward reference to enum types Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 08/10] lib: remove named variadic macros in exported headers Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 09/10] lib: hide static functions never defined Adrien Mazarguil
2016-09-08 12:25         ` [dpdk-dev] [PATCH v5 10/10] scripts: check compilation of exported header files Adrien Mazarguil
2016-09-13 13:38         ` [dpdk-dev] [PATCH v5 00/10] Fix build errors related to exported headers 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=1459865290-10248-5-git-send-email-adrien.mazarguil@6wind.com \
    --to=adrien.mazarguil@6wind.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.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).