[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#315198: libc6-dev: FTBFS with gcc-4.0: Fix xdr.h lvalue casts



Package: libc6-dev
Version: 2.3.2.ds1-22
Severity: normal
Tags: patch fixed-in-experimental

A package (dsniff) which includes rpc/xdr.h (generated code by rpcgen) 
FTBFS when compiled with gcc-4.0.
The following patch fixes this. Credits go to Joseph S. Myers:
http://sources.redhat.com/ml/libc-alpha/2004-03/msg00267.html

Note that the patch has been accepted upstream and it's in libc6 2.3.5,
included in experimental.

--- sunrpc/rpc/xdr.h	16 Dec 2002 02:05:49 -0000	1.27
+++ sunrpc/rpc/xdr.h	20 Mar 2004 16:42:13 -0000
@@ -262,10 +262,8 @@ struct xdr_discrim
  * and shouldn't be used any longer. Code which use this defines or longs
  * in the RPC code will not work on 64bit Solaris platforms !
  */
-#define IXDR_GET_LONG(buf) \
-	((long)ntohl((u_long)*__extension__((u_int32_t*)(buf))++))
-#define IXDR_PUT_LONG(buf, v) \
-	(*__extension__((u_int32_t*)(buf))++ = (long)htonl((u_long)(v)))
+#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
+#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))
 #define IXDR_GET_U_LONG(buf)	      ((u_long)IXDR_GET_LONG(buf))
 #define IXDR_PUT_U_LONG(buf, v)	      IXDR_PUT_LONG(buf, (long)(v))

Regards,
Faidon



Reply to: