summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-04-24 11:32:13 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-08-13 17:20:47 +0000
commitd549129538b65eee8549237ea2aaf7d59d89da2f (patch)
treed40dd377ef876a1ae8fe520e62ea0ed3b3afd97e /src
parent44d5dd7c1e6b150c21242ca1161762841dc78afb (diff)
vppinfra: selectively disable false-positive GCC-10 warnings
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> (cherry picked from commit ffbcf6178891bd68a97543ac91d28f37256d5e13)
Diffstat (limited to 'src')
-rw-r--r--src/vppinfra/random_buffer.h9
1 files changed, 9 insertions, 0 deletions
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 <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 */
/*