]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
try a different way to shut up gcc
authorAlan T. DeKok <aland@freeradius.org>
Tue, 23 Nov 2021 21:05:41 +0000 (16:05 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 23 Nov 2021 21:05:41 +0000 (16:05 -0500)
src/lib/unlang/xlat_builtin.c

index 8d69e7b2acf9b810b9d65cf35d5c373386eeaf3c..364c809396e43997d80ef85ab5fc8d88846d8fde 100644 (file)
@@ -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;
 }