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.
The extension keyword is used whenever the C99 syntax cannot do it.
This commit prevents the following errors:
error: ISO C forbids zero-size array `[...]'
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
struct rte_acl_field field[fld_num]; \
}
struct rte_acl_field field[fld_num]; \
}
-RTE_ACL_RULE_DEF(rte_acl_rule, 0);
+RTE_ACL_RULE_DEF(rte_acl_rule,);
#define RTE_ACL_RULE_SZ(fld_num) \
(sizeof(struct rte_acl_rule) + sizeof(struct rte_acl_field) * (fld_num))
#define RTE_ACL_RULE_SZ(fld_num) \
(sizeof(struct rte_acl_rule) + sizeof(struct rte_acl_field) * (fld_num))
} __rte_aligned(8);
/**< Public symmetric session details */
} __rte_aligned(8);
/**< Public symmetric session details */
/**< Private session material */
};
/**< Private session material */
};
struct rte_mempool *mp;
} __rte_aligned(8);
struct rte_mempool *mp;
} __rte_aligned(8);
+ __extension__ char _private[0];
};
struct rte_cryptodev_driver;
};
struct rte_cryptodev_driver;
volatile unsigned read; /**< Next position to be read */
unsigned len; /**< Circular buffer length */
unsigned elem_size; /**< Pointer size - for 32/64 bit OS */
volatile unsigned read; /**< Next position to be read */
unsigned len; /**< Circular buffer length */
unsigned elem_size; /**< Pointer size - for 32/64 bit OS */
- void * volatile buffer[0]; /**< The buffer contains mbuf pointers */
+ void *volatile buffer[]; /**< The buffer contains mbuf pointers */
uint32_t init_val; /**< For initialising hash function. */
/** A flat table of all buckets. */
uint32_t init_val; /**< For initialising hash function. */
/** A flat table of all buckets. */
- union rte_fbk_hash_entry t[0];
+ union rte_fbk_hash_entry t[];
struct ip_frag_pkt *last; /**< last used entry. */
struct ip_pkt_list lru; /**< LRU list for table entries. */
struct ip_frag_tbl_stat stat; /**< statistics counters. */
struct ip_frag_pkt *last; /**< last used entry. */
struct ip_pkt_list lru; /**< LRU list for table entries. */
struct ip_frag_tbl_stat stat; /**< statistics counters. */
- struct ip_frag_pkt pkt[0]; /**< hash table. */
+ struct ip_frag_pkt pkt[]; /**< hash table. */
};
/** IPv6 fragment extension header */
};
/** IPv6 fragment extension header */
__rte_cache_aligned; /**< LPM tbl24 table. */
struct rte_lpm_tbl_entry_v20 tbl8[RTE_LPM_TBL8_NUM_ENTRIES]
__rte_cache_aligned; /**< LPM tbl8 table. */
__rte_cache_aligned; /**< LPM tbl24 table. */
struct rte_lpm_tbl_entry_v20 tbl8[RTE_LPM_TBL8_NUM_ENTRIES]
__rte_cache_aligned; /**< LPM tbl8 table. */
- struct rte_lpm_rule_v20 rules_tbl[0] \
+ struct rte_lpm_rule_v20 rules_tbl[]
__rte_cache_aligned; /**< LPM rules. */
};
__rte_cache_aligned; /**< LPM rules. */
};
/* define a set of marker types that can be used to refer to set points in the
* mbuf */
/* define a set of marker types that can be used to refer to set points in the
* mbuf */
typedef void *MARKER[0]; /**< generic marker for a point in a structure */
typedef void *MARKER[0]; /**< generic marker for a point in a structure */
typedef uint8_t MARKER8[0]; /**< generic marker with 1B alignment */
typedef uint8_t MARKER8[0]; /**< generic marker with 1B alignment */
typedef uint64_t MARKER64[0]; /**< marker that allows us to overwrite 8 bytes
* with a single assignment */
typedef uint64_t MARKER64[0]; /**< marker that allows us to overwrite 8 bytes
* with a single assignment */
uint32_t table_id;
};
/** Start of table entry area for user defined actions and meta-data */
uint32_t table_id;
};
/** Start of table entry area for user defined actions and meta-data */
- uint8_t action_data[0];
+ __extension__ uint8_t action_data[0];
struct rte_ring_debug_stats stats[RTE_MAX_LCORE];
#endif
struct rte_ring_debug_stats stats[RTE_MAX_LCORE];
#endif
- void * ring[0] __rte_cache_aligned; /**< Memory space of ring starts here.
+ void *ring[] __rte_cache_aligned; /**< Memory space of ring starts here.
* not volatile so need to be careful
* about compiler re-ordering */
};
* not volatile so need to be careful
* about compiler re-ordering */
};
uint32_t go2; /**< Bitmap scan: Go/stop condition for current array2 cache line */
/* Storage space for array1 and array2 */
uint32_t go2; /**< Bitmap scan: Go/stop condition for current array2 cache line */
/* Storage space for array1 and array2 */