• Bug#265761: bayonne: FTBFS with gcc-3.4: ISO C++ forbids cast to non-re

    From Andreas Jochens@1:229/2 to All on Sat Aug 14 22:10:09 2004
    From: [email protected]

    Package: bayonne
    Severity: normal
    Tags: patch

    When building 'bayonne' with gcc-3.4 I get the following error:

    bayonne_xdr.c:422: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:423: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:424: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:425: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:458: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:459: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:460: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:461: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:462: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:463: error: ISO C++ forbids cast to non-reference type used as lvalue
    bayonne_xdr.c:464: error: ISO C++ forbids cast to non-reference type used as lvalue
    /usr/include/cc++2/cc++/socket.h: At global scope: /usr/include/cc++2/cc++/socket.h:147: warning: inline function `virtual void ost::InetMcastAddrValidator::operator()(in_addr) const' used but never defined
    make[3]: *** [sunrpc_mod-server.o] Error 1
    make[3]: Leaving directory `/bayonne-1.2.11/modules/sunrpc'

    With the attached patch 'bayonne' can be compiled using gcc-3.4.

    Regards
    Andreas Jochens

    diff -urN ../tmp-orig/bayonne-1.2.11/modules/sunrpc/bayonne_xdr.c ./modules/sunrpc/bayonne_xdr.c
    --- ../tmp-orig/bayonne-1.2.11/modules/sunrpc/bayonne_xdr.c 2002-08-07 17:09:55.000000000 +0200
    +++ ./modules/sunrpc/bayonne_xdr.c 2004-08-14 21:47:21.548413873 +0200
    @@ -66,12 +66,12 @@
    return FALSE;

    } else {
    - IXDR_PUT_LONG(buf, objp->pol_active);
    - IXDR_PUT_LONG(buf, objp->max_incoming);
    - IXDR_PUT_LONG(buf, objp->max_outgoing);
    - IXDR_PUT_LONG(buf, objp->tot_incoming);
    - IXDR_PUT_LONG(buf, objp->tot_outgoing);
    - IXDR_PUT_LONG(buf, objp->pol_members);
    + IXDR_PUT_INT32(buf, objp->pol_active);
    + IXDR_PUT_INT32(buf, objp->max_incoming);
    + IXDR_PUT_INT32(buf, objp->max_outgoing);
    + IXDR_PUT_INT32(buf, objp->tot_incoming);
    + IXDR_PUT_INT32(buf, objp->tot_outgoing);
    + IXDR_PUT_INT32(buf, objp->pol_members);
    }
    if (!xdr_array (xdrs, (char **)&objp->pol_ports.pol_ports_val, (u_int *) &objp->pol_ports.pol_ports_len, ~0,
    sizeof (int), (xdrproc_t) xdr_int))
    @@ -100,12 +100,12 @@
    return FALSE;

    } else {
    - objp->pol_active = IXDR_GET_LONG(buf);
    - objp