Front page | perl.perl5.porters |
Postings from April 2014
Re: FYI: sv.c warnings from blead on OS X 10.9
Thread Previous
|
Thread Next
From:
Craig A. Berry
Date:
April 27, 2014 19:57
Subject:
Re: FYI: sv.c warnings from blead on OS X 10.9
Message ID:
CA+vYcVx1p8q1xX+joAfbKo2Bwi4ghWvDCDM8JTEfFeOFALzTeg@mail.gmail.com
On Sun, Apr 27, 2014 at 12:53 PM, Jarkko Hietaniemi <jhi@iki.fi> wrote:
> The warnings:
>
> sv.c:2962:17: warning: cast to 'char *' from smaller integer type 'int'
> [-Wint-to-pointer-cast]
> V_Gconvert(SvNVX(sv), NV_DIG, 0, s);
> ^
> sv.c:55:16: note: expanded from macro 'V_Gconvert'
> char *rc = (char *)Gconvert(x,n,t,b); \
> ^
> sv.c:10550:7: warning: cast to 'char *' from smaller integer type 'int'
> [-Wint-to-pointer-cast]
> V_Gconvert(nv, (int)digits, 0, ebuf);
> ^
> sv.c:55:16: note: expanded from macro 'V_Gconvert'
> char *rc = (char *)Gconvert(x,n,t,b); \
> ^
> sv.c:11408:7: warning: cast to 'char *' from smaller integer type 'int'
> [-Wint-to-pointer-cast]
> V_Gconvert((NV)nv, (int)precis, 0, PL_efloatbuf);
> ^
> sv.c:55:16: note: expanded from macro 'V_Gconvert'
> char *rc = (char *)Gconvert(x,n,t,b); \
> ^
> 3 warnings generated.
>
> I have DEBUGGING now but I think I saw the warnings also without it:
It's complaining about the return value, which we're doing our best to
throw away and thereby emulate a void gconvert:
http://perl5.git.perl.org/perl.git/blob/HEAD:/sv.c#l49
which apparently fixed a different warning on Linux:
http://perl5.git.perl.org/perl.git/blobdiff/04783dc7025287c5d75ab531602c7ec786a1e787..cca0492ec62cab786a01ea96c47e549fe0aa8c61:/sv.c
I don't think it's doing any real harm, but warnings that need to be
ignored tend to accumulate and then it's too easy to ignore all
warnings.
It seems odd OS X's gcvt isn't selected for Gconvert:
$ ./perl -Ilib -V:d_Gconvert
d_Gconvert='sprintf((b),"%.*g",(n),(x))';
Perhaps the type of the fake return value of V_Gconvert needs to be
different depending on what underlying routine was selected for
Gconvert.
Thread Previous
|
Thread Next