1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Silence compiler warnings on clang 21

Clang 21 shows some new compiler warnings, for example:

warning: variable 'dstsize' is uninitialized when passed as a const pointer argument here [-Wuninitialized-const-pointer]

The fix is to initialize the variables when they are defined.  This is
similar to, for example, the existing situation in gistKeyIsEQ().

Discussion: https://www.postgresql.org/message-id/flat/6604ad6e-5934-43ac-8590-15113d6ae4b1%40eisentraut.org
This commit is contained in:
Peter Eisentraut
2025-09-12 07:27:48 +02:00
parent 3c02c46521
commit 14bb47567a
2 changed files with 3 additions and 3 deletions

View File

@@ -135,7 +135,7 @@ toast_save_datum(Relation rel, Datum value,
char data[TOAST_MAX_CHUNK_SIZE + VARHDRSZ];
/* ensure union is aligned well enough: */
int32 align_it;
} chunk_data;
} chunk_data = {0}; /* silence compiler warning */
int32 chunk_size;
int32 chunk_seq = 0;
char *data_p;