[dpdk-dev] mk: disable new gcc truncation flag

Message ID 20170602163116.4631-1-ndas@suse.de (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Nirmoy Das June 2, 2017, 4:31 p.m. UTC
  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=]

Signed-off-by: Nirmoy Das <ndas@suse.de>
---
 lib/librte_eal/linuxapp/kni/Makefile | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Markos Chandras June 2, 2017, 4:38 p.m. UTC | #1
On 06/02/2017 05:31 PM, Nirmoy Das wrote:
> 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=]
> 
> Signed-off-by: Nirmoy Das <ndas@suse.de>
> ---

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?
  
Markos Chandras June 12, 2017, 2:35 p.m. UTC | #2
On 06/02/2017 07:38 PM, Markos Chandras wrote:
> On 06/02/2017 05:31 PM, Nirmoy Das wrote:
>> 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=]
>>
>> Signed-off-by: Nirmoy Das <ndas@suse.de>
>> ---
> 
> 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
  
Nirmoy Das June 13, 2017, 9:18 a.m. UTC | #3
On 06/12/2017 04:35 PM, Markos Chandras wrote:
> On 06/02/2017 07:38 PM, Markos Chandras wrote:
>> On 06/02/2017 05:31 PM, Nirmoy Das wrote:
>>> 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=]
>>>
>>> Signed-off-by: Nirmoy Das <ndas@suse.de>
>>> ---
>> 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
  
Markos Chandras June 13, 2017, 10:01 a.m. UTC | #4
On 06/13/2017 12:18 PM, Nirmoy Das wrote:
> 
> 
> On 06/12/2017 04:35 PM, Markos Chandras wrote:
>> On 06/02/2017 07:38 PM, Markos Chandras wrote:
>>> On 06/02/2017 05:31 PM, Nirmoy Das wrote:
>>>> 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=]
>>>>
>>>> Signed-off-by: Nirmoy Das <ndas@suse.de>
>>>> ---
>>> 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:

Reviewed-by: Markos Chandras <mchandras@suse.de>
  

Patch

diff --git a/lib/librte_eal/linuxapp/kni/Makefile b/lib/librte_eal/linuxapp/kni/Makefile
index 154c528db..79bb498dd 100644
--- a/lib/librte_eal/linuxapp/kni/Makefile
+++ b/lib/librte_eal/linuxapp/kni/Makefile
@@ -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