develooper Front page | perl.perl5.porters | Postings from March 2000

Re: [ID 20000315.017] Not OK: perl 5.6.0 RC2 on dos-djgpp

Thread Previous | Thread Next
Philip Newton
March 16, 2000 23:10
Re: [ID 20000315.017] Not OK: perl 5.6.0 RC2 on dos-djgpp
Message ID:
OK, after changing math.h so that the three functions in question are only seen 
#ifndef functionname, compile gets further. Now it stops at the following point:

`sh  cflags libperl.a pp_sys.o`  pp_sys.c
          CCCMD =  gcc -DPERL_CORE -c -DPERL_EXTERNAL_GLOB -fno-strict-aliasing
-O2 -malign-loops=2 -malign-jumps=2 -malign-functions=2
pp_sys.c: In function `Perl_pp_sysread':
pp_sys.c:1507: warning: assignment makes pointer from integer without a cast
pp_sys.c:1509: warning: comparison between pointer and integer
pp_sys.c:1510: invalid operands to binary +
pp_sys.c:1510: invalid operands to binary -
make.exe: *** [pp_sys.o] Error 1

The lines in question are:

bash$ sed -n -e '1507,1510p' pp_sys.c
    bufsize = SvCUR(bufsv);
    buffer = SvGROW(bufsv, length+offset+1);
    if (offset > bufsize) { /* Zero any newly allocated space */
        Zero(buffer+bufsize, offset-bufsize, char);

bufsize is a Sock_size_t, and offset is an int.

grep Sock_size_t *.h returns the following:
config.h:/* Sock_size_t:
config.h:#define Sock_size_t            char * /**/

char * does look pointerish to me; however, it doesn't look much like the type of 
something that's supposed to hold a size. has: socksizetype='char *'

This, in turn, appears to come from the following in Configure:

: check for type of the size argument to socket calls
case "$d_socket" in
        $cat <<EOM

Checking to see what type is the last argument of accept().
        hdrs="$define sys/types.h $d_socket sys/socket.h"
        case "$d_socklen_t" in
        "$define") yyy="$yyy socklen_t"
        yyy="$yyy $sizetype int long"
        for xxx in $yyy; do
                case "$socksizetype" in
                '')     try="extern int accept(int, struct sockaddr *, $xxx *);"
                        if ./protochk "$try" $hdrs; then
                                echo "Your system accepts '$xxx *' for the last
argument of accept()."
: In case none of those worked, prompt the user.
        case "$socksizetype" in
        '')     rp='What is the type for socket address structure sizes?'
                . ./myread
*)      : no sockets, so pick relatively harmless defaults
        socksizetype='char *'

Well, DJGPP has no sockets, so Configure picked a "relatively harmless default"; 
this, however, appears not to be useful at all. Probably, the "harmless default" 
should be int, or maybe long.

Or, possibly, the bit in pp_sys.c should do into an #ifdef HAS_SOCKET block; 
there are already some bits in Perl_pp_sysread that are #ifdef HAS_SOCKET. From 
what I can gather, this last bit is probably the best idea. I'll try it and see 
how far I get.

Philip Newton <>

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About