From 525585206b7fcbf78361a5ce49c60e2963e7c6f4 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 24 Jul 2022 09:55:56 -0700 Subject: [PATCH] ast fmtbuf: squash -Wsign-compare warning This is computing the number of bytes remaining in `buf`; the number of bytes between a pointer to the current offset and the end of `buf`. Thus it is always non-negative. --- lib/ast/fmtbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ast/fmtbuf.c b/lib/ast/fmtbuf.c index 09a58cfe5..ffe99d0b7 100644 --- a/lib/ast/fmtbuf.c +++ b/lib/ast/fmtbuf.c @@ -10,6 +10,7 @@ #include +#include /* * return small format buffer chunk of size n @@ -23,7 +24,7 @@ char *fmtbuf(size_t n) { char *cur; - if (n > (&buf[elementsof(buf)] - nxt)) + if (n > (size_t)(&buf[elementsof(buf)] - nxt)) nxt = buf; cur = nxt; nxt += n; -- 2.40.0