develooper Front page | perl.perl5.porters | Postings from August 2001

pp_sys.c compile failed..

From:
Scott Fletcher
Date:
August 13, 2001 09:38
Subject:
pp_sys.c compile failed..
Message ID:
B344E1B1390FD5119D640002B3252E709E64@abcmail.abcoa.com
	Hey, the email subscription work!  Took me a while to figure it out!

	By the way, I'm using AIX 4.3.2 and I'm installing Perl on this
machine.  I'm using Perl 5.6.1.  As I was compiling, it stopped with a
compile errors.  The error message said .....

--- Begin Clip ---
        `sh  cflags libperl.a pp_sys.o`  pp_sys.c
          CCCMD =  cc -DPERL_CORE -c -D_ALL_SOURCE -D_ANSI_C_SOURCE
-D_POSIX_SOURCE -qmaxmem=16384 -I/usr/local/include -q32 -D_LARGE_FILES
-qlonglong -O 
"pp_sys.c", line 4356.14: 1506-068 (W) Operation between types "struct
hostent*" and "int" is not allowed.
"pp_sys.c", line 4367.14: 1506-068 (W) Operation between types "struct
hostent*" and "int" is not allowed.
"pp_sys.c", line 4388.21: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
"pp_sys.c", line 4389.35: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
"pp_sys.c", line 4389.49: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
"pp_sys.c", line 4392.37: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
"pp_sys.c", line 4399.29: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
"pp_sys.c", line 4401.21: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
"pp_sys.c", line 4407.26: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
"pp_sys.c", line 4409.15: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
"pp_sys.c", line 4418.13: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
"pp_sys.c", line 4419.27: 1506-285 (S) The indirection operator cannot be
applied to a pointer to an incomplete struct or union.
--- End Clip ---

	So I looked into the pp_sys.c file on those error message and saw
the code here and it looked fine to me.  I'm pretty much clueless on this
one.   Is there a patch to fix this problem???  Here's the code below.

--- Begin Clip ---
PP(pp_ghostent)       ((((((((( Line 4428 )))))))))
{
    dSP;
#if defined(HAS_GETHOSTBYNAME) || defined(HAS_GETHOSTBYADDR) ||
defined(HAS_GETHOSTENT)
    I32 which = PL_op->op_type;
    register char **elem;
    register SV *sv;
#ifndef HAS_GETHOST_PROTOS /* XXX Do we need individual probes? */
    struct hostent *PerlSock_gethostbyaddr(Netdb_host_t, Netdb_hlen_t, int);
(((((((((  This is where the errors start )))))))))))
    struct hostent *PerlSock_gethostbyname(Netdb_name_t);
    struct hostent *PerlSock_gethostent(void);
#endif
    struct hostent *hent;
    unsigned long len;
    STRLEN n_a;

    EXTEND(SP, 10);
    if (which == OP_GHBYNAME)
#ifdef HAS_GETHOSTBYNAME
	hent = PerlSock_gethostbyname(POPpx);
#else
	DIE(aTHX_ PL_no_sock_func, "gethostbyname");
#endif
    else if (which == OP_GHBYADDR) {
#ifdef HAS_GETHOSTBYADDR
	int addrtype = POPi;
	SV *addrsv = POPs;
	STRLEN addrlen;
	Netdb_host_t addr = (Netdb_host_t) SvPV(addrsv, addrlen);

	hent = PerlSock_gethostbyaddr(addr, (Netdb_hlen_t) addrlen,
addrtype);
#else
	DIE(aTHX_ PL_no_sock_func, "gethostbyaddr");
#endif
    }
    else
#ifdef HAS_GETHOSTENT
	hent = PerlSock_gethostent();
#else
	DIE(aTHX_ PL_no_sock_func, "gethostent");
#endif

#ifdef HOST_NOT_FOUND
    if (!hent)
	STATUS_NATIVE_SET(h_errno);
#endif

    if (GIMME != G_ARRAY) {
	PUSHs(sv = sv_newmortal());
	if (hent) {
	    if (which == OP_GHBYNAME) {
		if (hent->h_addr)
		    sv_setpvn(sv, hent->h_addr, hent->h_length);
	    }
	    else
		sv_setpv(sv, (char*)hent->h_name);
	}
	RETURN;
    }

    if (hent) {
	PUSHs(sv = sv_mortalcopy(&PL_sv_no));
	sv_setpv(sv, (char*)hent->h_name);
	PUSHs(sv = sv_mortalcopy(&PL_sv_no));
	for (elem = hent->h_aliases; elem && *elem; elem++) {
	    sv_catpv(sv, *elem);
	    if (elem[1])
		sv_catpvn(sv, " ", 1);
	}
	PUSHs(sv = sv_mortalcopy(&PL_sv_no));
	sv_setiv(sv, (IV)hent->h_addrtype);
	PUSHs(sv = sv_mortalcopy(&PL_sv_no));
	len = hent->h_length;
	sv_setiv(sv, (IV)len);
#ifdef h_addr
	for (elem = hent->h_addr_list; elem && *elem; elem++) {
	    XPUSHs(sv = sv_mortalcopy(&PL_sv_no));
	    sv_setpvn(sv, *elem, len);
	}
#else
	PUSHs(sv = sv_mortalcopy(&PL_sv_no));
	if (hent->h_addr)
	    sv_setpvn(sv, hent->h_addr, len);
#endif /* h_addr */
    }
    RETURN;
#else
    DIE(aTHX_ PL_no_sock_func, "gethostent");
#endif
}
--- End Clip ---

Thanks,
  Scott F.



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