This causes a clang warning:
parser_json.c:767:6: warning: variable 'opt_type' is uninitialized when used here [-Wuninitialized]
if (opt_type < DCCPOPT_TYPE_MIN || opt_type > DCCPOPT_TYPE_MAX) {
^~~~~~~~
... because it deduces the object is readonly.
Signed-off-by: Florian Westphal <fw@strlen.de>
static struct expr *json_parse_dccp_option_expr(struct json_ctx *ctx,
const char *type, json_t *root)
{
- const int opt_type;
+ int opt_type;
if (json_unpack_err(ctx, root, "{s:i}", "type", &opt_type))
return NULL;