From d549129538b65eee8549237ea2aaf7d59d89da2f Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Fri, 24 Apr 2020 11:32:13 +0200 Subject: vppinfra: selectively disable false-positive GCC-10 warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit ffbcf6178891bd68a97543ac91d28f37256d5e13) --- src/vppinfra/random_buffer.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/vppinfra/random_buffer.h b/src/vppinfra/random_buffer.h index eb318548b0a..320394d1862 100644 --- a/src/vppinfra/random_buffer.h +++ b/src/vppinfra/random_buffer.h @@ -40,6 +40,11 @@ #include #include +#include + +/* *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 */ /* -- cgit 1.2.3-korg