From 0d61a23cc6a7628bb9ada98ae7a65700dc1fd2f7 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 18 Sep 2019 20:22:39 +0100 Subject: [PATCH 1/1] struct/buf.c: Muffle an annoying Clang warning about a pointless assertion. Of course, since this code is macro-generated, it's not at all pointless. --- struct/buf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/struct/buf.c b/struct/buf.c index 1ac6bb9..d86904c 100644 --- a/struct/buf.c +++ b/struct/buf.c @@ -31,6 +31,7 @@ #include #include "buf.h" +#include "macros.h" /*----- Main code ---------------------------------------------------------*/ @@ -273,7 +274,9 @@ void *buf_getmemz(buf *b, size_t *nn) #define BUF_PUTMEM_(n, W, w) \ int buf_putmem##w(buf *b, const void *p, size_t sz) \ { \ - assert(sz <= MASK##W); \ + MUFFLE_WARNINGS_STMT \ + (CLANG_WARNING("-Wtautological-constant-out-of-range-compare"), \ + { assert(sz <= MASK##W); }); \ if (buf_putu##w(b, sz) || buf_put(b, p, sz)) \ return (-1); \ return (0); \ -- 2.11.0