From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Remove objname/objargs split for referring to objects
Date: Fri, 17 Mar 2017 14:39:26 -0300
Message-ID: <20170317173926.7uhydgrmg3qh6xup@alvherre.pgsql> (raw)
In-Reply-To: <ced13759-6c79-cfb7-3f29-8797cb2b7402@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Peter Eisentraut wrote:
> cc -Wall -Wmissing-prototypes -Wpointer-arith
> -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
> -Wformat-security -fno-strict-aliasing -fwrapv
> -fexcess-precision=standard -g -O2 -I../../../src/include
> -D_FORTIFY_SOURCE=2 -DLINUX_OOM_ADJ -D_GNU_SOURCE -I/usr/include/libxml2
> -c -o objectaddress.o objectaddress.c
> objectaddress.c: In function ‘get_object_address’:
> objectaddress.c:1650:24: warning: ‘typeoids[1]’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> objectaddress.c:1582:6: note: ‘typeoids[1]’ was declared here
> objectaddress.c:1627:43: warning: ‘typenames[1]’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> objectaddress.c:1581:12: note: ‘typenames[1]’ was declared here
> objectaddress.c:1650:24: warning: ‘typeoids[0]’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> objectaddress.c:1582:6: note: ‘typeoids[0]’ was declared here
> objectaddress.c:1627:43: warning: ‘typenames[0]’ may be used
> uninitialized in this function [-Wmaybe-uninitialized]
> objectaddress.c:1581:12: note: ‘typenames[0]’ was declared here
>
> cc (Debian 4.7.2-5) 4.7.2
Oh yeah, buildfarm member sitella shows that. Does the attached patch
fix it? (pretty much the same thing Michael attached, but we also need
to handle typeoids)
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackersAttachments:objaddr-warn.patch (text/plain, 767B) downloaddiff --git a/src/backend/catalog/objectaddress.c b/src/backend/catalog/objectaddress.cindex 8ccc171..7f73fc0 100644--- a/src/backend/catalog/objectaddress.c+++ b/src/backend/catalog/objectaddress.c@@ -1578,8 +1578,8 @@ get_object_address_opf_member(ObjectType objtype,
ObjectAddress address;
ListCell *cell;
List *copy;
- TypeName *typenames[2];- Oid typeoids[2];+ TypeName *typenames[2] = { NULL, NULL };+ Oid typeoids[2] = { InvalidOid, InvalidOid };
int membernum;
int i;
@@ -1607,6 +1607,9 @@ get_object_address_opf_member(ObjectType objtype,
break;
}
+ Assert(typenames[0] != NULL && typenames[1] != NULL);+ Assert(typeoids[0] != InvalidOid && typeoids[1] != InvalidOid);+
switch (objtype)
{
case OBJECT_AMOP:
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: alvherre@2ndquadrant.com, peter.eisentraut@2ndquadrant.com, michael.paquier@gmail.com, pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Remove objname/objargs split for referring to objects
In-Reply-To: <20170317173926.7uhydgrmg3qh6xup@alvherre.pgsql>
References: <ced13759-6c79-cfb7-3f29-8797cb2b7402@2ndquadrant.com> <20170317173926.7uhydgrmg3qh6xup@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox