net: fix build with -Wpedantic
PATCH 1/1 net: fix build with -Wpedantic
Adds the __extension__ attribute to resolve the following warning with gcc 4.8.5 on CentOS 7:lib/net/rte_macsec.h:38:2: error: type of bit-field 'short_length' is
a GCC extension [-Werror=pedantic]
--- lib/net/rte_macsec.h | 1 + 1 file changed, 1 insertion(+)
lib/net/rte_macsec.h +1 -0
@@ -28,6 +28,7 @@ extern "C" {/** * MACsec Header (SecTAG) */ +__extension__ struct rte_macsec_hdr { /** * Tag control information and Association number of secure channel.
Signature · 1 line
2.25.1
Quoted 18 lines
Adds the
__extension__attribute to resolve the following warning with gcc 4.8.5 on CentOS 7:lib/net/rte_macsec.h:38:2: error: type of bit-field 'short_length' is
a GCC extension [-Werror=pedantic]Fixes 0aaf097585a6 ("ethdev: add MACsec flow item")Signed-off-by Ali Alnubani <[email protected]>--- lib/net/rte_macsec.h | 1 + 1 file changed, 1 insertion(+)lib/net/rte_macsec.h +0
-0
lib/net/rte_macsec.h extern "C" { · line 31
Quoted 4 lines
lib/net/rte_macsec.h +1
-0@@ -28,6 +28,7 @@ extern "C" {/** * MACsec Header (SecTAG) */ +__extension__
RTE_STD_C11 ??
Quoted 5 lines
lib/net/rte_macsec.h +0
-1struct rte_macsec_hdr {/** * Tag control information and Association number of secure channel. -- 2.25.1
Quoted 19 lines
-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Thursday, September 29, 2022 10:02 AM
To: Ali Alnubani <[email protected]>; [email protected]
Subject: RE: [EXT] [PATCH] net: fix build with -WpedanticQuoted 13 lines
Adds the
__extension__attribute to resolve the following warning with gcc 4.8.5 on CentOS 7:lib/net/rte_macsec.h:38:2: error: type of bit-field 'short_length' is
a GCC extension [-Werror=pedantic]Fixes 0aaf097585a6 ("ethdev: add MACsec flow item")Signed-off-by Ali Alnubani <[email protected]>--- lib/net/rte_macsec.h | 1 + 1 file changed, 1 insertion(+)
Quoted 11 lines
lib/net/rte_macsec.h extern "C" { · line 31
Quoted 9 lines
lib/net/rte_macsec.h +1
-0@@ -28,6 +28,7 @@ extern "C" {/** * MACsec Header (SecTAG) */ +__extension__
RTE_STD_C11??
Replacing the __extension__ attribute with RTE_STD_C11 doesn't resolve the build failure for me.
Akhil Goyal
Acked-byQuoted 25 lines
Quoted 13 lines
Quoted 13 lines
Adds the
__extension__attribute to resolve the following warning with gcc 4.8.5 on CentOS 7:lib/net/rte_macsec.h:38:2: error: type of bit-field 'short_length' is
a GCC extension [-Werror=pedantic]Fixes 0aaf097585a6 ("ethdev: add MACsec flow item")Signed-off-by Ali Alnubani <[email protected]>--- lib/net/rte_macsec.h | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
lib/net/rte_macsec.h extern "C" { · line 31
Quoted 9 lines
lib/net/rte_macsec.h +1
-0@@ -28,6 +28,7 @@ extern "C" {/** * MACsec Header (SecTAG) */ +__extension__
RTE_STD_C11??
Quoted 2 lines
Replacing the
__extension__attribute withRTE_STD_C11doesn't resolve the build failure for me.
Ok, Thanks for the fix.
Thomas Monjalon
Applied29/09/2022 09:09, Akhil Goyal:
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 18 lines
Adds the
__extension__attribute to resolve the following warning with gcc 4.8.5 on CentOS 7:lib/net/rte_macsec.h:38:2: error: type of bit-field 'short_length' is
a GCC extension [-Werror=pedantic]Fixes 0aaf097585a6 ("ethdev: add MACsec flow item")Signed-off-by Ali Alnubani <[email protected]>--- lib/net/rte_macsec.h | 1 + 1 file changed, 1 insertion(+)lib/net/rte_macsec.h +0
-0lib/net/rte_macsec.h extern "C" { · line 31
Quoted 4 lines
lib/net/rte_macsec.h +1
-0@@ -28,6 +28,7 @@ extern "C" {/** * MACsec Header (SecTAG) */ +__extension__
RTE_STD_C11??
Quoted 6 lines
Quoted 2 lines
Replacing the
__extension__attribute withRTE_STD_C11doesn't resolve the build failure for me.Ok, Thanks for the fix.
Acked-by Akhil Goyal <[email protected]>
Applied, thanks.
29/09/2022 09:01, Akhil Goyal:
Quoted 8 lines
Quoted 8 lines
Adds the
__extension__attribute to resolve the following warning with gcc 4.8.5 on CentOS 7:lib/net/rte_macsec.h:38:2: error: type of bit-field 'short_length' is
a GCC extension [-Werror=pedantic]Fixes 0aaf097585a6 ("ethdev: add MACsec flow item")
Quoted 11 lines
lib/net/rte_macsec.h extern "C" { · line 31
Quoted 9 lines
Signed-off-by Ali Alnubani <[email protected]>---
lib/net/rte_macsec.h +1
-0@@ -28,6 +28,7 @@ extern "C" {/** * MACsec Header (SecTAG) */ +__extension__
RTE_STD_C11??
We use RTE_STD_C11 only for anonymous struct and union. I don't know why we don't use it for bitfield in struct. It seems to be part of C11 standard, right?
In doubt, I would continue with __extension__
and we can replace all similar occurences in a separate patch, if confirmed it is well defined in C11.