mirror of
https://github.com/postgres/postgres.git
synced 2025-12-11 00:05:53 -05:00
Suppress maybe-uninitialized warning.
Following commit e035863c9a0, 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
This commit is contained in:
parent
80c758a2e1
commit
b5c53b403c
@ -561,7 +561,7 @@ inv_write(LargeObjectDesc *obj_desc, const char *buf, int nbytes)
|
|||||||
char data[LOBLKSIZE + VARHDRSZ];
|
char data[LOBLKSIZE + VARHDRSZ];
|
||||||
/* ensure union is aligned well enough: */
|
/* ensure union is aligned well enough: */
|
||||||
int32 align_it;
|
int32 align_it;
|
||||||
} workbuf;
|
} workbuf = {0};
|
||||||
char *workb = VARDATA(&workbuf.hdr);
|
char *workb = VARDATA(&workbuf.hdr);
|
||||||
HeapTuple newtup;
|
HeapTuple newtup;
|
||||||
Datum values[Natts_pg_largeobject];
|
Datum values[Natts_pg_largeobject];
|
||||||
@ -752,7 +752,7 @@ inv_truncate(LargeObjectDesc *obj_desc, int64 len)
|
|||||||
char data[LOBLKSIZE + VARHDRSZ];
|
char data[LOBLKSIZE + VARHDRSZ];
|
||||||
/* ensure union is aligned well enough: */
|
/* ensure union is aligned well enough: */
|
||||||
int32 align_it;
|
int32 align_it;
|
||||||
} workbuf;
|
} workbuf = {0};
|
||||||
char *workb = VARDATA(&workbuf.hdr);
|
char *workb = VARDATA(&workbuf.hdr);
|
||||||
HeapTuple newtup;
|
HeapTuple newtup;
|
||||||
Datum values[Natts_pg_largeobject];
|
Datum values[Natts_pg_largeobject];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user