Uninitialized variable introduced in 3217327053638085d24dd4d276e7c1f7ac2c4c6b

Started by Mark Dilgeralmost 9 years ago3 messages
#1Mark Dilger
hornschnorter@gmail.com

Peter,

Can you perhaps initialize the variable 'address' to suppress the warning? Thanks.

Mark Dilger

tablecmds.c:5984:6: warning: variable 'address' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (generatedEl)
^~~~~~~~~~~
tablecmds.c:5999:9: note: uninitialized use occurs here
return address;
^~~~~~~
tablecmds.c:5984:2: note: remove the 'if' if its condition is always true
if (generatedEl)
^~~~~~~~~~~~~~~~
tablecmds.c:5936:2: note: variable 'address' is declared here
ObjectAddress address;
^

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#2Peter Eisentraut
peter.eisentraut@2ndquadrant.com
In reply to: Mark Dilger (#1)
Re: Uninitialized variable introduced in 3217327053638085d24dd4d276e7c1f7ac2c4c6b

On 4/6/17 10:59, Mark Dilger wrote:

Can you perhaps initialize the variable 'address' to suppress the warning? Thanks.

A potential fix for this has been pushed.

tablecmds.c:5984:6: warning: variable 'address' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (generatedEl)
^~~~~~~~~~~
tablecmds.c:5999:9: note: uninitialized use occurs here
return address;
^~~~~~~
tablecmds.c:5984:2: note: remove the 'if' if its condition is always true
if (generatedEl)
^~~~~~~~~~~~~~~~
tablecmds.c:5936:2: note: variable 'address' is declared here
ObjectAddress address;
^

--
Peter Eisentraut http://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-hackers

#3Mark Dilger
hornschnorter@gmail.com
In reply to: Peter Eisentraut (#2)
Re: Uninitialized variable introduced in 3217327053638085d24dd4d276e7c1f7ac2c4c6b

On Apr 6, 2017, at 8:33 AM, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:

On 4/6/17 10:59, Mark Dilger wrote:

Can you perhaps initialize the variable 'address' to suppress the warning? Thanks.

A potential fix for this has been pushed.

It works for me. Thanks again.

Mark Dilger

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers