From: Tom Lane Date: Fri, 5 Apr 2024 14:58:30 +0000 (-0400) Subject: Suppress "variable may be used uninitialized" warning. X-Git-Tag: REL_17_BETA1~394 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=3c5ff36aba8a3df19967d0ddc1249c63417bb9b0;p=postgresql.git Suppress "variable may be used uninitialized" warning. Buildfarm member caiman is showing this, which surprises me because it's very late-model gcc (14.0.1) and ought to be smart enough to know that elog(ERROR) doesn't return. But we're likely to see the same from stupider compilers too, so add a dummy initialization in our usual style. --- diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 2f87255c470..56a531de8db 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -4276,6 +4276,7 @@ transformJsonFuncExpr(ParseState *pstate, JsonFuncExpr *func) break; default: elog(ERROR, "invalid JsonFuncExpr op %d", (int) func->op); + default_format = JS_FORMAT_DEFAULT; /* keep compiler quiet */ break; }