summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/random_buffer.h
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2020-04-24 11:32:13 +0200
committerDave Barach <openvpp@barachs.net>2020-04-27 12:22:30 +0000
commitffbcf6178891bd68a97543ac91d28f37256d5e13 (patch)
tree2ced78a92b8fbc884ff6798ca33ad324cbb9e9e8 /src/vppinfra/random_buffer.h
parentbe7dbbbfdd49fcfff851f38d1d36d08fc9710604 (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>
Diffstat (limited to 'src/vppinfra/random_buffer.h')
-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 */
/*