vppinfra: selectively disable false-positive GCC-10 warnings 88/26688/3
authorBenoît Ganne <bganne@cisco.com>
Fri, 24 Apr 2020 09:32:13 +0000 (11:32 +0200)
committerDave Barach <openvpp@barachs.net>
Mon, 27 Apr 2020 12:22:30 +0000 (12:22 +0000)
GCC-10 increase overflows-related warnings but failed to infer that
b->n_cached_bytes is always < sizeof(uword).

Type: fix

Change-Id: I956ae609abc9e39d4a932e5801510999d7d27b79
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/vppinfra/random_buffer.h

index eb31854..320394d 100644 (file)
 
 #include <vppinfra/clib.h>
 #include <vppinfra/random_isaac.h>
+#include <vppinfra/warnings.h>
+
+/* *INDENT-OFF* */
+WARN_OFF(array-bounds)
+/* *INDENT-ON* */
 
 typedef struct
 {
@@ -107,6 +112,10 @@ clib_random_buffer_get_data (clib_random_buffer_t * b, uword n_bytes)
     return b->buffer + i;
 }
 
+/* *INDENT-OFF* */
+WARN_ON(array-bounds)
+/* *INDENT-ON* */
+
 #endif /* included_clib_random_buffer_h */
 
 /*