On Thu, Mar 16, 2017 at 12:18 AM, Alvaro Herrera
<[email protected]> wrote:
> Peter Eisentraut wrote:
>> Remove objname/objargs split for referring to objects
>
> I don't know if this is the guilty commit, but I'm now getting these
> compiler warnings:
>
>
> /pgsql/source/master/src/backend/catalog/objectaddress.c: In function
> 'get_object_address':
> /pgsql/source/master/src/backend/catalog/objectaddress.c:1624:33: warning:
> 'typenames[1]' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
> ereport(ERROR,
> ^
> /pgsql/source/master/src/backend/catalog/objectaddress.c:1578:8: note:
> 'typenames[1]' was declared here
> char *typenames[2];
> ^
> /pgsql/source/master/src/backend/catalog/objectaddress.c:1624:33: warning:
> 'typenames[0]' may be used uninitialized in this function
> [-Wmaybe-uninitialized]
> ereport(ERROR,
> ^
> /pgsql/source/master/src/backend/catalog/objectaddress.c:1578:8: note:
> 'typenames[0]' was declared here
> char *typenames[2];
> ^
What are you using as CFLAGS? As both typenames should be normally
set, what about initializing those fields with NULL and add an
assertion like the attached?
--
Michael
diff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.c
index 3a7f049247..52df94439d 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -1552,7 +1552,7 @@ get_object_address_opf_member(ObjectType objtype,
ObjectAddress address;
ListCell *cell;
List *copy;
- char *typenames[2];
+ char *typenames[2] = {NULL, NULL};
Oid typeoids[2];
int membernum;
int i;
@@ -1581,6 +1581,8 @@ get_object_address_opf_member(ObjectType objtype,
break;
}
+ Assert(typenames[0] != NULL && typenames[1] != NULL);
+
switch (objtype)
{
case OBJECT_AMOP:
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers