vppinfra: fix memcpy undefined behaviour
[vpp.git] / src / vppinfra / memcpy_sse3.h
index 5e4bf7d..aea2005 100644 (file)
 
 #include <stdint.h>
 #include <x86intrin.h>
+#include <vppinfra/warnings.h>
+
+/* *INDENT-OFF* */
+WARN_OFF (stringop-overflow)
+/* *INDENT-ON* */
 
 static inline void
 clib_mov16 (u8 * dst, const u8 * src)
@@ -183,7 +188,7 @@ clib_mov256 (u8 * dst, const u8 * src)
 })
 
 static inline void *
-clib_memcpy (void *dst, const void *src, size_t n)
+clib_memcpy_fast_sse3 (void *dst, const void *src, size_t n)
 {
   __m128i xmm0, xmm1, xmm2, xmm3, xmm4, xmm5, xmm6, xmm7, xmm8;
   uword dstu = (uword) dst;
@@ -344,6 +349,9 @@ clib_memcpy (void *dst, const void *src, size_t n)
   goto COPY_BLOCK_64_BACK15;
 }
 
+/* *INDENT-OFF* */
+WARN_ON (stringop-overflow)
+/* *INDENT-ON* */
 
 #undef CLIB_MVUNALIGN_LEFT47_IMM
 #undef CLIB_MVUNALIGN_LEFT47