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

Build warning in PerlIOStdio_set_ptrcnt() under Cygwin

Thread Next
Jerry D. Hedden
September 19, 2012 07:45
Build warning in PerlIOStdio_set_ptrcnt() under Cygwin
Message ID:
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
-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
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:

PerlIOStdio_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt)
    FILE * const stdio = PerlIOSelf(f, PerlIOStdio)->stdio;
    if (ptr != NULL) {
	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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About