new warning

Started by Kevin Grittnerabout 14 years ago3 messages
#1Kevin Grittner
Kevin.Grittner@wicourts.gov

This commit adds a new warning on my machine:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d326d9e8ea1d690cf6d968000efaa5121206d231

copy.c: In function *DoCopy*:
copy.c:1861:14: warning: *bufferedTuples* may be used uninitialized
in this function

-Kevin

#2Robert Haas
robertmhaas@gmail.com
In reply to: Kevin Grittner (#1)
Re: new warning

On Wed, Nov 9, 2011 at 11:12 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:

This commit adds a new warning on my machine:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d326d9e8ea1d690cf6d968000efaa5121206d231

copy.c: In function *DoCopy*:
copy.c:1861:14: warning: *bufferedTuples* may be used uninitialized
in this function

Yeah, I was just noticing that. It looks like it's just a case of the
compiler failing to see that there can't be a problem in real life, so
I pushed a fix to initialize it to NULL.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#3Greg Jaskiewicz
gj@pointblue.com.pl
In reply to: Robert Haas (#2)
Re: new warning

On 9 Nov 2011, at 16:16, Robert Haas wrote:

On Wed, Nov 9, 2011 at 11:12 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:

This commit adds a new warning on my machine:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=d326d9e8ea1d690cf6d968000efaa5121206d231

copy.c: In function *DoCopy*:
copy.c:1861:14: warning: *bufferedTuples* may be used uninitialized
in this function

Yeah, I was just noticing that. It looks like it's just a case of the
compiler failing to see that there can't be a problem in real life, so
I pushed a fix to initialize it to NULL.

Yes, but one day someone will add some more code there - and will forget to initialise it to NULL.. Kabboom. ;)