]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Pedantic
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 16 Jan 2021 21:48:10 +0000 (21:48 +0000)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 16 Jan 2021 21:54:38 +0000 (21:54 +0000)
src/bin/unit_test_attribute.c
src/lib/unlang/compile.c

index f58d7209a90af1b39fe5a7d4647df2ac92a3fc51..909f9364a8550e7ddb0f4a27f6928f5c92d74e01 100644 (file)
@@ -2151,6 +2151,7 @@ static size_t command_tmpl_rules(command_result_t *result, command_file_ctx_t *c
        fr_sbuff_t              sbuff = FR_SBUFF_IN(in, inlen);
        ssize_t                 slen;
        command_tmpl_rule_func  func;
+       void                    *res;
 
        static fr_table_ptr_sorted_t tmpl_rule_func_table[] = {
                { L("allow_foreign"),           (void *)command_tmpl_rule_allow_foreign         },
@@ -2167,12 +2168,13 @@ static size_t command_tmpl_rules(command_result_t *result, command_file_ctx_t *c
        while (fr_sbuff_extend(&sbuff)) {
                fr_sbuff_adv_past_whitespace(&sbuff, SIZE_MAX, NULL);
 
-               fr_sbuff_out_by_longest_prefix(&slen, &func, tmpl_rule_func_table, &sbuff, NULL);
-               if (func == NULL) {
+               fr_sbuff_out_by_longest_prefix(&slen, &res, tmpl_rule_func_table, &sbuff, NULL);
+               if (res == NULL) {
                        fr_strerror_printf("Specified rule \"%pV\" is invalid",
                                           fr_box_strvalue_len(fr_sbuff_current(&sbuff), fr_sbuff_remaining(&sbuff)));
                        RETURN_COMMAND_ERROR();
                }
+               func = (command_tmpl_rule_func)res;     /* -Wpedantic */
 
                fr_sbuff_adv_past_whitespace(&sbuff, SIZE_MAX, NULL);
 
index 4c16ae37046715d4b523482d59f0c6b851294808..e3072e1c33b3d196b79057f8807be5e14037fa56 100644 (file)
@@ -3526,7 +3526,7 @@ static unlang_t *compile_item(unlang_t *parent, unlang_compile_t *unlang_ctx, CO
                        return compile_tmpl(parent, unlang_ctx, cp);
                }
 
-               compile = fr_table_value_by_str(unlang_pair_keywords, name, NULL);
+               compile = (unlang_op_compile_t)fr_table_value_by_str(unlang_pair_keywords, name, NULL); /* Cast for -Wpedantic */
                if (compile) return compile(parent, unlang_ctx, ci);
 
                /*