pgsql: Suppress uninitialized-variable warning.

Started by Tom Laneover 15 years ago7 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Suppress uninitialized-variable warning.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=b3cfcdaad27bea9bb86d6de6cbf8d184c16fbceb

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

#2Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#1)
Re: pgsql: Suppress uninitialized-variable warning.

Which compiler did that come out of? I don't think I saw it on any of
the ones I tried..

//Magnus

On Sun, Jan 23, 2011 at 19:08, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Suppress uninitialized-variable warning.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=b3cfcdaad27bea9bb86d6de6cbf8d184c16fbceb

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

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

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#2)
Re: pgsql: Suppress uninitialized-variable warning.

Magnus Hagander <magnus@hagander.net> writes:

Which compiler did that come out of? I don't think I saw it on any of
the ones I tried..

gcc 4.4.5, standard on Fedora 13. I'm surprised that yours did not show
it, because the usage pattern looks beyond gcc's ability to prove safe.

regards, tom lane

#4Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#3)
Re: pgsql: Suppress uninitialized-variable warning.

On Sun, Jan 23, 2011 at 19:21, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Magnus Hagander <magnus@hagander.net> writes:

Which compiler did that come out of? I don't think I saw it on any of
the ones I tried..

gcc 4.4.5, standard on Fedora 13.  I'm surprised that yours did not show
it, because the usage pattern looks beyond gcc's ability to prove safe.

Interesting. I just make clean/make:ed it again to make sure, and it
doesn't. And I'm on:
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#4)
Re: pgsql: Suppress uninitialized-variable warning.

Magnus Hagander <magnus@hagander.net> writes:

On Sun, Jan 23, 2011 at 19:21, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Magnus Hagander <magnus@hagander.net> writes:

Which compiler did that come out of? I don't think I saw it on any of
the ones I tried..

gcc 4.4.5, standard on Fedora 13. �I'm surprised that yours did not show
it, because the usage pattern looks beyond gcc's ability to prove safe.

Interesting. I just make clean/make:ed it again to make sure, and it
doesn't. And I'm on:
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

[ scratches head... ] Maybe you are using different switches, perhaps
optimization higher than -O2?

But anyway, I think the project policy for such things is that we want
to suppress warnings when feasible on all common compilers, so the patch
is appropriate no matter what the specific reason for the difference is.

regards, tom lane

#6Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#5)
Re: pgsql: Suppress uninitialized-variable warning.

On Sun, Jan 23, 2011 at 19:36, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Magnus Hagander <magnus@hagander.net> writes:

On Sun, Jan 23, 2011 at 19:21, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Magnus Hagander <magnus@hagander.net> writes:

Which compiler did that come out of? I don't think I saw it on any of
the ones I tried..

gcc 4.4.5, standard on Fedora 13.  I'm surprised that yours did not show
it, because the usage pattern looks beyond gcc's ability to prove safe.

Interesting. I just make clean/make:ed it again to make sure, and it
doesn't. And I'm on:
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

[ scratches head... ]  Maybe you are using different switches, perhaps
optimization higher than -O2?

Nope...

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing
-fwrapv -g -I../../../src/interfaces/libpq -I../../../src/include
-D_GNU_SOURCE -c -o pg_basebackup.o pg_basebackup.c -MMD -MP -MF
.deps/pg_basebackup.Po

gives no output at all.

But anyway, I think the project policy for such things is that we want
to suppress warnings when feasible on all common compilers, so the patch
is appropriate no matter what the specific reason for the difference is.

Oh yes, I totally agree. I'm just trying to figure out why I didn't
see it myself.

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

#7Devrim GÜNDÜZ
devrim@gunduz.org
In reply to: Tom Lane (#5)
Re: pgsql: Suppress uninitialized-variable warning.

On Sun, 2011-01-23 at 13:36 -0500, Tom Lane wrote:

gcc 4.4.5, standard on Fedora 13. I'm surprised that yours did not

show

it, because the usage pattern looks beyond gcc's ability to prove

safe.

Interesting. I just make clean/make:ed it again to make sure, and it
doesn't. And I'm on:
gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5

[ scratches head... ] Maybe you are using different switches, perhaps
optimization higher than -O2?

Maybe there is a Fedora specific patch that causes this issue?
--
Devrim GÜNDÜZ
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
PostgreSQL RPM Repository: http://yum.pgrpms.org
Community: devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
http://www.gunduz.org Twitter: http://twitter.com/devrimgunduz