develooper Front page | perl.perl5.porters | Postings from October 2013

[perl #116296] [PATCH] remove PL_patchlevel from and optimize S_minus_v

Thread Previous | Thread Next
From:
bulk88 via RT
Date:
October 29, 2013 22:08
Subject:
[perl #116296] [PATCH] remove PL_patchlevel from and optimize S_minus_v
Message ID:
rt-4.0.18-24529-1383084466-1452.116296-15-0@perl.org
On Thu Jul 18 18:32:42 2013, tonyc wrote:
> On Thu Jul 18 11:57:36 2013, bulk88 wrote:
> > On Sun Jul 07 23:53:42 2013, tonyc wrote:
> > >
> > > Tony
> > >
> >
> > Patch remade, newSVpvn and %d replaced with %zu to hopefully (not
> > using
> > GCC) stop type mismatch warning.
> >
> 
> Thanks for the newSVpvn change, unfortunately the format string error
> remains:
> 
> CCCMD =  cc -DPERL_CORE -c -D_REENTRANT -D_GNU_SOURCE
> -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -std=c89 -O2  -Wall -ansi
> -W
> -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat
> -Wwrite-strings
> perl.c: In function ‘S_minus_v’:
> perl.c:3600:9: warning: format ‘%s’ expects argument of type ‘char *’,
> but argument 3 has type ‘long unsigned int’ [-Wformat]
> 
> From clang:
> 
> perl.c:3555:9: warning: format specifies type 'char *' but the
> argument
> has type
>       'size_t' (aka 'unsigned long') [-Wformat]
>         INT2PTR(size_t, LOCAL_PATCH_COUNT),
>         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ./perl.h:1630:26: note: expanded from macro 'INT2PTR'
> #  define INT2PTR(any,d)        (any)(d)
>                                 ^~~~~~~~
> Note that ANSI C doesn't guarantee that size_t and pointers are the
> same
> size, though I can only think an obsolete platform (Win16 large model)
> where they are different sizes.

Patch remade, warning silenced on my clang 3.1 and gcc 4.5.3. I thought of doing a "#pragma clang diagnostic ignored "-Wformat"" also, but it seems unnecessary since clang implemented enough of gcc warnings pragma to work.

-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=116296

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About