develooper Front page | perl.perl5.porters | Postings from September 2012

Build warning in PerlIOStdio_set_ptrcnt() under Cygwin

Thread Next
From:
Jerry D. Hedden
Date:
September 19, 2012 07:45
Subject:
Build warning in PerlIOStdio_set_ptrcnt() under Cygwin
Message ID:
CABcAEYxW8mG-rw1kXviQrJnYOGZPyLVLHRou4XNPu4vCM_v1=A@mail.gmail.com
I'm seeing the following build warning for blead:

`sh  cflags "optimize='-Os -pipe -funit-at-a-time -march=pentium4
-mfpmath=sse -mieee-fp -mmmx -msse -msse2'" perlio.o`  perlio.c
	  CCCMD =  gcc -DPERL_CORE -c -DPERL_USE_SAFE_PUTENV
-U__STRICT_ANSI__ -DNO_MATHOMS -fno-strict-aliasing -pipe
-fstack-protector -I/usr/local/include  -Os -pipe -funit-at-a-time
-march=pentium4 -mfpmath=sse -mieee-fp -mmmx -msse -msse2 -Wall -W
-Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat
-Wwrite-strings
perlio.c: In function 'PerlIOStdio_set_ptrcnt':
perlio.c:3569:2: warning: pointer targets in assignment differ in signedness

The offending line in perlio.c is the PerlSIO_set_ptr() macro below:

void
PerlIOStdio_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt)
{
    FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
    if (ptr != NULL) {
#ifdef STDIO_PTR_LVALUE
	PerlSIO_set_ptr(stdio, ptr); /* LHS STDCHAR* cast non-portable */

Tracing through macros and header files, I find that the issue is that
the "STDCHAR *ptr" is getting assigned to "_p" in the structure below
(from /usr/include/sys/reent.h):

struct __sFILE {
  unsigned char *_p;	/* current position in (some) buffer */

I'm using Cygwin, so my question is if anyone else is seeing this, or
is this Cygwin specific?

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