]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Silence "may be used uninitialized" compiler warning.
authorNathan Bossart <nathan@postgresql.org>
Thu, 18 Jun 2026 16:29:49 +0000 (11:29 -0500)
committerNathan Bossart <nathan@postgresql.org>
Thu, 18 Jun 2026 16:29:49 +0000 (11:29 -0500)
Newer gcc warns that this "actual_arg_types" variable may be used
uninitialized, but visual inspection indicates there's no bug.  To
silence the warning, initialize the variable to zeros.

Bug: #19485
Reported-by: Hans Buschmann <buschmann@nidsa.net>
Tested-by: Erik Rijkers <er@xs4all.nl>
Tested-by: Hans Buschmann <buschmann@nidsa.net>
Reviewed-by: Tristan Partin <tristan@partin.io>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/19485-2b03231a775756f1%40postgresql.org
Discussion: https://postgr.es/m/6c52a1a6612948519468d46cb224a8c4%40nidsa.net

src/backend/optimizer/util/clauses.c

index 07738894d1af138860e6824c8cc3d6df53d752f8..01997e222668006397e8278cd50a0101875bf8c4 100644 (file)
@@ -5138,7 +5138,7 @@ recheck_cast_function_args(List *args, Oid result_type,
 {
        Form_pg_proc funcform = (Form_pg_proc) GETSTRUCT(func_tuple);
        int                     nargs;
-       Oid                     actual_arg_types[FUNC_MAX_ARGS];
+       Oid                     actual_arg_types[FUNC_MAX_ARGS] = {0};
        Oid                     declared_arg_types[FUNC_MAX_ARGS];
        Oid                     rettype;
        ListCell   *lc;