Re: New compile warnings

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New compile warnings
Date: 2004-11-21 02:02:56
Message-ID: 419FF750.5000409@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:

>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>
>
>>I am seeing the following compile warnings in CVS. I am using for perl:
>> Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
>>
>>
>
>I believe these two:
>
>
>
>>plperl.c:948: warning: `ret_hv' might be used uninitialized in this function
>>plperl.c:949: warning: `ret_av' might be used uninitialized in this function
>>
>>
>
>indicate an actual bug --- at least, it's far from clear that the code
>can't try to use an uninitialized value. I trust that the authors of
>plperl will step up and fix it; I'm not sufficiently clear on what cases
>they are trying to support to want to touch it.
>
>

I have just mentally walked through the code and I am fairly sure this
is harmless, i.e. we should only refer to the one of these that has
actually been set in any of the relevant code paths. I agree it is
sloppy and will have discussions with one or two fellow perpetrators er
I mean collaborators about cleaning it up.

>The others indicate sloppiness in the C code generated by perl's XS
>functionality. There's nothing we can do about them. FWIW, less
>obsolete versions of Perl generate fewer warnings --- the only one of
>these that I see on 5.8.0 and up is
>
>
>
>>SPI.c:158: warning: unused variable `items'
>>
>>

This message can actually be fixed with the addition of the following 2
lines to SPI.xs:

*BOOT*:
*items* = 0; /* avoid '*unused **variable*' warning */

These messages are confusing:

/usr/libdata/perl5/5.00503/i386-bsdos/CORE/patchlevel.h:41: warning: `local_patches' defined but not used
ppport.h:564: warning: `sv_2pv_nolen' defined but not used
/usr/libdata/perl5/5.00503/i386-bsdos/CORE/patchlevel.h:41: warning: `local_patches' defined but not used
ppport.h:564: warning: `sv_2pv_nolen' defined but not used

AFAICT sv_2pv_nolen should actually be used (by SPI.c) on Bruce's machine, so it's a bit strange.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-11-21 02:14:36 Re: New compile warnings
Previous Message Joe Conway 2004-11-21 00:23:11 Re: cvs web errors

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2004-11-21 02:14:36 Re: New compile warnings
Previous Message Tom Lane 2004-11-20 16:53:31 Re: New compile warnings