Skip to contentSkip to conversation

mk: disable new gcc truncation flag

PATCH In review Nirmoy Das 3 participants 8 messages Jun 2, 2017 – Jun 13, 2017

lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

PATCH 1/1 mk: disable new gcc truncation flag

disable truncation check to ignore below warning
dpdk/x86_64-native-linuxapp-gcc-default/build/lib/librte_eal/linuxapp/kni/igb_main.c:2476:30: error: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 11 [-Werror=format-truncation=]

---
 lib/librte_eal/linuxapp/kni/Makefile | 3 +++
 1 file changed, 3 insertions(+)
lib/librte_eal/linuxapp/kni/Makefile +3 -0
index 154c528db..79bb498dd 100644
@@ -43,6 +43,9 @@ MODULE_CFLAGS += -I$(SRCDIR) --param max-inline-insns-single=50
 MODULE_CFLAGS += -I$(RTE_OUTPUT)/include -I$(SRCDIR)/ethtool/ixgbe -I$(SRCDIR)/ethtool/igb
 MODULE_CFLAGS += -include $(RTE_OUTPUT)/include/rte_config.h
 MODULE_CFLAGS += -Wall -Werror
+ifeq ($(shell test $(GCC_VERSION) -ge 70 && echo 1), 1)
+MODULE_CFLAGS += -Wno-format-truncation
+endif
 
 -include /etc/lsb-release
 
Signature · 1 line
2.12.2
#1 lore raw
Quoted 5 lines · Nirmoy Das

disable truncation check to ignore below warning
dpdk/x86_64-native-linuxapp-gcc-default/build/lib/librte_eal/linuxapp/kni/igb_main.c:2476:30: error: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 11 [-Werror=format-truncation=]

---

I haven't check the code but is this a bogus warning or a real one? If it's bogus then could you explain why in the commit message so we do not bring it back in the future? If it's a real problem, then perhaps worth fixing it instead of masking it?

Signature · 4 lines
markos

SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg
#2 lore raw
Quoted 4 lines · Markos Chandras
Quoted 3 lines · Nirmoy Das

disable truncation check to ignore below warning
dpdk/x86_64-native-linuxapp-gcc-default/build/lib/librte_eal/linuxapp/kni/igb_main.c:2476:30: error: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 11 [-Werror=format-truncation=]

Quoted 8 lines
Quoted 2 lines

---

I haven't check the code but is this a bogus warning or a real one? If it's bogus then could you explain why in the commit message so we do not bring it back in the future? If it's a real problem, then perhaps worth fixing it instead of masking it?

Actually this should have already been fixed in the series posted in
http://dpdk.org/ml/archives/dev/2017-May/065261.html

Signature · 4 lines
markos

SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg
author
#3 lore raw
Quoted 7 lines · Markos Chandras
Quoted 6 lines · Markos Chandras
Quoted 5 lines · Nirmoy Das

disable truncation check to ignore below warning
dpdk/x86_64-native-linuxapp-gcc-default/build/lib/librte_eal/linuxapp/kni/igb_main.c:2476:30: error: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 11 [-Werror=format-truncation=]

---

Quoted 7 lines
Quoted 5 lines

I haven't check the code but is this a bogus warning or a real one? If it's bogus then could you explain why in the commit message so we do not bring it back in the future? If it's a real problem, then perhaps worth fixing it instead of masking it?

Actually this should have already been fixed in the series posted in
http://dpdk.org/ml/archives/dev/2017-May/065261.html

I see the issue in master with CONFIG_RTE_KNI_KMOD_ETHTOOL=y

Reviewed-by
#4 lore raw
Quoted 10 lines · Nirmoy Das
Quoted 7 lines · Markos Chandras
Quoted 6 lines · Markos Chandras
Quoted 5 lines · Nirmoy Das

disable truncation check to ignore below warning
dpdk/x86_64-native-linuxapp-gcc-default/build/lib/librte_eal/linuxapp/kni/igb_main.c:2476:30: error: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 11 [-Werror=format-truncation=]

---

Quoted 9 lines
Quoted 7 lines
Quoted 5 lines

I haven't check the code but is this a bogus warning or a real one? If it's bogus then could you explain why in the commit message so we do not bring it back in the future? If it's a real problem, then perhaps worth fixing it instead of masking it?

Actually this should have already been fixed in the series posted in
http://dpdk.org/ml/archives/dev/2017-May/065261.html

I see the issue in master with CONFIG_RTE_KNI_KMOD_ETHTOOL=y

Yeah I think you are right. This doesn't seem to have been fixed yet. In the end, I think your patch is good so:

Signature · 4 lines
markos

SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg
#5 lore raw
In reply to Nirmoy Das
Quoted 10 lines · Nirmoy Das
Quoted 7 lines · Markos Chandras
Quoted 6 lines · Markos Chandras
Quoted 5 lines · Nirmoy Das

disable truncation check to ignore below warning
dpdk/x86_64-native-linuxapp-gcc-default/build/lib/librte_eal/linuxapp/kni/igb_main.c:2476:30: error: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 11 [-Werror=format-truncation=]

---

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

I haven't check the code but is this a bogus warning or a real one? If it's bogus then could you explain why in the commit message so we do not bring it back in the future? If it's a real problem, then perhaps worth fixing it instead of masking it?

Actually this should have already been fixed in the series posted in
http://dpdk.org/ml/archives/dev/2017-May/065261.html

I see the issue in master with CONFIG_RTE_KNI_KMOD_ETHTOOL=y

I confirm the build error, and patch fixes it.

Although that piece of code most probably will not be used at all, and previous solution was to disable warnings, since this warning is only single place in KNI code, it is easy to fix and I am for fixing it [1], what do you think?

(quoted diff) +0 -0

b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
index d077b49e9..8667f29ca 100644

lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h +1 -1
@@ -607,7 +607,7 @@ struct igb_adapter {
        int int_mode;
        u32 rss_queues;
        u32 vmdq_pools;
-       char fw_version[32];
+       char fw_version[43];
        u32 wvbr;
        struct igb_mac_addr *mac_table;
 #ifdef CONFIG_IGB_VMDQ_NETDEV
#6 lore raw
Quoted 35 lines · Ferruh Yigit
Quoted 10 lines · Nirmoy Das
Quoted 7 lines · Markos Chandras
Quoted 6 lines · Markos Chandras
Quoted 5 lines · Nirmoy Das

disable truncation check to ignore below warning
dpdk/x86_64-native-linuxapp-gcc-default/build/lib/librte_eal/linuxapp/kni/igb_main.c:2476:30: error: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 11 [-Werror=format-truncation=]

---

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

I haven't check the code but is this a bogus warning or a real one? If it's bogus then could you explain why in the commit message so we do not bring it back in the future? If it's a real problem, then perhaps worth fixing it instead of masking it?

Actually this should have already been fixed in the series posted in
http://dpdk.org/ml/archives/dev/2017-May/065261.html

I see the issue in master with CONFIG_RTE_KNI_KMOD_ETHTOOL=y

I confirm the build error, and patch fixes it.

Although that piece of code most probably will not be used at all, and previous solution was to disable warnings, since this warning is only single place in KNI code, it is easy to fix and I am for fixing it [1], what do you think?

lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h +0 -0
index d077b49e9..8667f29ca 100644

lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h struct igb_adapter { · line 613

Quoted 8 lines
lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h +1 -1
@@ -607,7 +607,7 @@ struct igb_adapter {
        int int_mode;
        u32 rss_queues;
        u32 vmdq_pools;
-       char fw_version[32];
+       char fw_version[43];
        u32 wvbr;
        struct igb_mac_addr *mac_table;
 #ifdef CONFIG_IGB_VMDQ_NETDEV

Looks reasonable to me

Signature · 4 lines
markos

SUSE LINUX GmbH | GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg) Maxfeldstr. 5, D-90409, Nürnberg
#7 lore raw
Quoted 38 lines · Markos Chandras
Quoted 37 lines · Ferruh Yigit
Quoted 10 lines · Nirmoy Das
Quoted 7 lines · Markos Chandras
Quoted 6 lines · Markos Chandras
Quoted 5 lines · Nirmoy Das

disable truncation check to ignore below warning
dpdk/x86_64-native-linuxapp-gcc-default/build/lib/librte_eal/linuxapp/kni/igb_main.c:2476:30: error: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size between 0 and 11 [-Werror=format-truncation=]

---

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines

I haven't check the code but is this a bogus warning or a real one? If it's bogus then could you explain why in the commit message so we do not bring it back in the future? If it's a real problem, then perhaps worth fixing it instead of masking it?

Actually this should have already been fixed in the series posted in
http://dpdk.org/ml/archives/dev/2017-May/065261.html

I see the issue in master with CONFIG_RTE_KNI_KMOD_ETHTOOL=y

I confirm the build error, and patch fixes it.

Although that piece of code most probably will not be used at all, and previous solution was to disable warnings, since this warning is only single place in KNI code, it is easy to fix and I am for fixing it [1], what do you think?

lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h +0 -0
index d077b49e9..8667f29ca 100644
@@ -607,7 +607,7 @@ struct igb_adapter {
        int int_mode;
        u32 rss_queues;
        u32 vmdq_pools;
Quoted 8 lines

lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h struct igb_adapter { · line 613

Quoted 6 lines
lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h +1 -1
-       char fw_version[32];
+       char fw_version[43];
        u32 wvbr;
        struct igb_mac_addr *mac_table;
 #ifdef CONFIG_IGB_VMDQ_NETDEV

Looks reasonable to me

Sent http://dpdk.org/dev/patchwork/patch/25297/