From: Alan T. DeKok Date: Sun, 17 Jan 2021 14:07:14 +0000 (-0500) Subject: wrap macro in `do { ... } while (0)` to shut up compiler X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a7a7caf2665b4edd7d1153de3da0902941cbfbf;p=thirdparty%2Ffreeradius-server.git wrap macro in `do { ... } while (0)` to shut up compiler --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index 661c46092ce..475fcd8bb68 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -558,8 +558,10 @@ int fr_value_box_cmp(fr_value_box_t const *a, fr_value_box_t const *b) /* * Short-hand for simplicity. */ -#define CHECK(_type) if (a->datum._type < b->datum._type) { compare = -1; \ - } else if (a->datum._type > b->datum._type) { compare = +1; } +#define CHECK(_type) do { \ + if (a->datum._type < b->datum._type) { compare = -1; \ + } else if (a->datum._type > b->datum._type) { compare = +1; } \ + } while (0) case FR_TYPE_BOOL: CHECK(boolean);