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

Message ID 21d80064-8edb-8537-1b59-cb482a56b547@intel.com (mailing list archive)
State Not Applicable, archived
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation fail apply patch file failure

Commit Message

Ferruh Yigit June 13, 2017, 1:45 p.m. UTC
  On 6/13/2017 10:18 AM, 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

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?
  

Comments

Markos Chandras June 13, 2017, 1:49 p.m. UTC | #1
On 06/13/2017 04:45 PM, Ferruh Yigit wrote:
> On 6/13/2017 10:18 AM, 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
> 
> 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?
> 
> 
> diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
> b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
> index d077b49e9..8667f29ca 100644
> --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
> +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
> @@ -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
  
Ferruh Yigit June 13, 2017, 4:50 p.m. UTC | #2
On 6/13/2017 2:49 PM, Markos Chandras wrote:
> On 06/13/2017 04:45 PM, Ferruh Yigit wrote:
>> On 6/13/2017 10:18 AM, 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
>>
>> 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?
>>
>>
>> diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
>> b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
>> index d077b49e9..8667f29ca 100644
>> --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
>> +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
>> @@ -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

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

Patch

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
index d077b49e9..8667f29ca 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h
@@ -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