From: Alan T. DeKok Date: Tue, 23 Nov 2021 21:05:41 +0000 (-0500) Subject: try a different way to shut up gcc X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=516ca947e6de330533043ac95f2b24c67e1e144f;p=thirdparty%2Ffreeradius-server.git try a different way to shut up gcc --- diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index 8d69e7b2acf..364c809396e 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -240,6 +240,7 @@ xlat_t *xlat_register_legacy(void *mod_inst, char const *name, xlat_t *xlat_register(TALLOC_CTX *ctx, char const *name, xlat_func_t func, xlat_flags_t const *flags) { xlat_t *c; + static const xlat_flags_t my_flags = (xlat_flags_t) { 0 }; if (!xlat_root) xlat_init(); @@ -248,7 +249,7 @@ xlat_t *xlat_register(TALLOC_CTX *ctx, char const *name, xlat_func_t func, xlat_ return NULL; } - if (!flags) flags = &(xlat_flags_t) { 0 }; + if (!flags) flags = &my_flags; /* * If it already exists, replace the instance. @@ -300,6 +301,7 @@ xlat_t *xlat_register(TALLOC_CTX *ctx, char const *name, xlat_func_t func, xlat_ * non-pure functions don't need to be async. */ fr_assert(!flags->needs_async || !flags->pure); + fr_assert(!flags->needs_resolving); return c; }