[master] 30a2df725 Silence FlexeLint

Poul-Henning Kamp phk at FreeBSD.org
Mon Jul 19 15:45:06 UTC 2021


commit 30a2df725bbb701751697f40cb1f14e36707daa2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jul 19 15:37:14 2021 +0000

    Silence FlexeLint

diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c
index d270b0ef1..eda2ff1f0 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -82,13 +82,15 @@ vcc_vcl_met2c(struct vsb *vsb, unsigned method)
 	int d = 0;
 
 	//lint -e{774} Boolean within 'if' always evaluates to False
-#define VCL_MET_MAC(l,U,t,b)			\
-	if (method & VCL_MET_##U) {		\
-		if (d)				\
-			VSB_putc(vsb, '|');	\
-		VSB_cat(vsb, "VCL_MET_" #U);	\
-		d = 1;				\
-	}
+#define VCL_MET_MAC(l,U,t,b)				\
+        do {						\
+		if (method & VCL_MET_##U) {		\
+			if (d)				\
+				VSB_putc(vsb, '|');	\
+			VSB_cat(vsb, "VCL_MET_" #U);	\
+			d = 1;				\
+		}					\
+        } while (0);
 #include "tbl/vcl_returns.h"
 	AN(d);
 }


More information about the varnish-commit mailing list