On Fri, Apr 17, 2020 at 5:44 PM Kevin Traynor <ktray...@redhat.com> wrote: > > stringop-overflow warns when it sees a possible overflow > in a string operation. > > In the rte_memcpy functions different branches are taken > depending on the size. stringop-overflow is raised for the > branches in the function where it sees the static size of the > src could be overflowed. > > However, in reality a correct size argument and in some cases > dynamic allocation would ensure that this does not happen. > > For example, in the case below for key, the correct path will be > chosen in rte_memcpy_generic at runtime based on the size argument > but as some paths in the function could lead to a cast to 32 bytes > a warning is raised. > > In function ‘_mm256_storeu_si256’, > inlined from ‘rte_memcpy_generic’ > at ../lib/librte_eal/common/include/arch/x86/rte_memcpy.h:315:2, > inlined from ‘iavf_configure_rss_key’ > at ../lib/librte_eal/common/include/arch/x86/rte_memcpy.h:869:10: > > /usr/lib/gcc/x86_64-redhat-linux/10/include/avxintrin.h:928:8: > warning: writing 32 bytes into a region of size 1 [-Wstringop-overflow=] > 928 | *__P = __A; > | ~~~~~^~~~~ > In file included > from ../drivers/net/iavf/../../common/iavf/iavf_prototype.h:10, > from ../drivers/net/iavf/iavf.h:9, > from ../drivers/net/iavf/iavf_vchnl.c:22: > > ../drivers/net/iavf/iavf_vchnl.c: > In function ‘iavf_configure_rss_key’: > > ../drivers/net/iavf/../../common/iavf/virtchnl.h:508:5: > note: at offset 0 to object ‘key’ with size 1 declared here > 508 | u8 key[1]; /* RSS hash key, packed bytes */ > | ^~~ > > Ignore the stringop-overflow warnings for rte_memcpy.h functions. > > Bugzilla ID: 394 > Bugzilla ID: 421 >
Cc: sta...@dpdk.org > Signed-off-by: Kevin Traynor <ktray...@redhat.com> Acked-by: Bruce Richardson <bruce.richardson@@intel.com> Acked-by: Konstantin Ananyev <konstantin.anan...@intel.com> Applied, thanks. -- David Marchand