From: Arran Cudbard-Bell Date: Sat, 16 Jan 2021 21:48:10 +0000 (+0000) Subject: Pedantic X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bc9090796db534934ec835bf6dafc3b7cbc73ec;p=thirdparty%2Ffreeradius-server.git Pedantic --- diff --git a/src/bin/unit_test_attribute.c b/src/bin/unit_test_attribute.c index f58d7209a90..909f9364a85 100644 --- a/src/bin/unit_test_attribute.c +++ b/src/bin/unit_test_attribute.c @@ -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); diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 4c16ae37046..e3072e1c33b 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -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); /*