Skip to content

Commit

Permalink
net: fix pedantic build
Browse files Browse the repository at this point in the history
[ upstream commit e4f9eab ]

when trying to compile rte_mpls with pedantic enabled,
on old compilers like 4.8 it will complain about bit field definition.

error: type of bit-field 'bs' is a GCC extension [-Werror=pedantic]
error: type of bit-field 'tc' is a GCC extension [-Werror=pedantic]
error: type of bit-field 'tag_lsb' is a GCC extension [-Werror=pedantic]

This fixes the compilation error by adding extension to the header
definition.

Fixes: e480cf4 ("net: add MPLS header structure")

Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
raslandarawsheh authored and kevintraynor committed Aug 27, 2020
1 parent 59b99c4 commit 544af62
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/librte_net/rte_mpls.h
Expand Up @@ -21,6 +21,7 @@ extern "C" {
/**
* MPLS header.
*/
__extension__
struct mpls_hdr {
uint16_t tag_msb; /**< Label(msb). */
#if RTE_BYTE_ORDER == RTE_BIG_ENDIAN
Expand Down

0 comments on commit 544af62

Please sign in to comment.