Skip to content

Commit b5c53b4

Browse files
Suppress maybe-uninitialized warning.
Following commit e035863, building with -O0 began triggering warnings about potentially uninitialized 'workbuf' usage. While theoretically the initialization isn't necessary since VARDATA() doesn't access the contents of the pointed-to object, this commit explicitly initializes the workbuf variable to suppress the warning. Buildfarm members adder and flaviventris have shown the warning. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAD21AoCOZxfqnNgfM5yVKJZYnOq5m2Q96fBGy1fovEqQ9V4OZA@mail.gmail.com
1 parent 80c758a commit b5c53b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/storage/large_object/inv_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes)
561561
char data[LOBLKSIZE + VARHDRSZ];
562562
/* ensure union is aligned well enough: */
563563
int32 align_it;
564-
} workbuf;
564+
} workbuf = {0};
565565
char *workb = VARDATA(&workbuf.hdr);
566566
HeapTuple newtup;
567567
Datum values[Natts_pg_largeobject];
@@ -752,7 +752,7 @@ inv_truncate(LargeObjectDesc *obj_desc, int64 len)
752752
char data[LOBLKSIZE + VARHDRSZ];
753753
/* ensure union is aligned well enough: */
754754
int32 align_it;
755-
} workbuf;
755+
} workbuf = {0};
756756
char *workb = VARDATA(&workbuf.hdr);
757757
HeapTuple newtup;
758758
Datum values[Natts_pg_largeobject];

0 commit comments

Comments
 (0)