Commit af8a94d1 authored by Joe Conway's avatar Joe Conway

Silence uninitialized variable compiler warning in sepgsql

At -Og optimization gcc warns that variable tclass may be used
uninitialized when relkind == RELKIND_INDEX. Actually that can't
happen due to an early return, but quiet the compiler by initializing
tclass to 0.

In passing, use uint16_t consistently for the declaration of tclass.

Complaint and initial patch by Mike Palmiotto. Editorializing by me.
Probably not worth backpatching given that it is cosmetic, so apply
to development head only.

Discussion: https://postgr.es/m/flat/623bcaae-112e-ced0-8c22-a84f75ae0c53%40joeconway.com
parent bd190eae
...@@ -243,7 +243,7 @@ sepgsql_relation_post_create(Oid relOid) ...@@ -243,7 +243,7 @@ sepgsql_relation_post_create(Oid relOid)
HeapTuple tuple; HeapTuple tuple;
Form_pg_class classForm; Form_pg_class classForm;
ObjectAddress object; ObjectAddress object;
uint16 tclass; uint16_t tclass;
char *scontext; /* subject */ char *scontext; /* subject */
char *tcontext; /* schema */ char *tcontext; /* schema */
char *rcontext; /* relation */ char *rcontext; /* relation */
...@@ -413,7 +413,7 @@ sepgsql_relation_drop(Oid relOid) ...@@ -413,7 +413,7 @@ sepgsql_relation_drop(Oid relOid)
{ {
ObjectAddress object; ObjectAddress object;
char *audit_name; char *audit_name;
uint16_t tclass; uint16_t tclass = 0;
char relkind; char relkind;
relkind = get_rel_relkind(relOid); relkind = get_rel_relkind(relOid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment