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
From:
Philip Newton
Date:
March 16, 2000 23:10
Subject:
Re: [ID 20000315.017] Not OK: perl 5.6.0 RC2 on dos-djgpp
Message ID:
200003170709.IAA09837@smtp1.nikoma.de
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.

configh.sh 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
"$define")
        $cat <<EOM

Checking to see what type is the last argument of accept().
EOM
        hdrs="$define sys/types.h $d_socket sys/socket.h"
        yyy=''
        case "$d_socklen_t" in
        "$define") yyy="$yyy socklen_t"
        esac
        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()."
                                socksizetype="$xxx"
                        fi
                        ;;
                esac
        done
: In case none of those worked, prompt the user.
        case "$socksizetype" in
        '')     rp='What is the type for socket address structure sizes?'
                dflt='int'
                . ./myread
                socksizetype=$ans
                ;;
        esac
        ;;
*)      : no sockets, so pick relatively harmless defaults
        socksizetype='char *'
        ;;
esac

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.

Cheers,
Philip
-- 
Philip Newton <Philip.Newton@gmx.net>

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