> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Tuesday, June 26, 2018 12:38 PM
> To: Yigit, Ferruh <[email protected]>
> Cc: [email protected]; [email protected]; De Lara Guarch, Pablo
> <[email protected]>; [email protected]
> Subject: [PATCH v3] kni: fix build with gcc 8.1
> 
> Error observed when CONFIG_RTE_KNI_KMOD_ETHTOOL config option is
> enabled.
> 
> build error:
> In function ‘strncpy’,
>     inlined from ‘igb_get_drvinfo’ at
>     .../dpdk/build/build/kernel/linux/kni/igb_ethtool.c:814:2:
>     .../include/linux/string.h:246:9: error: ‘__builtin_strncpy’ output
>     may be truncated copying 31 bytes from a string of length 42
>     [-Werror=stringop-truncation]
>       return __builtin_strncpy(p, q, size);
>                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Fixed by using strlcpy instead of strncpy.
> 
> adapter->fw_version size kept same because of
> c3698192940c ("kni: fix build with gcc 7.1")
> 
> Also next line strncpy usage replaced with strlcpy while arround.
> 
> Fixes: c3698192940c ("kni: fix build with gcc 7.1")
> Cc: [email protected]
> 
> Signed-off-by: Ferruh Yigit <[email protected]>

Acked-by: Pablo de Lara <[email protected]>

Reply via email to