]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR other/14884 ([3.3 only] rpc/xdr.h should be fixincluded)
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Sat, 30 Apr 2005 17:14:28 +0000 (17:14 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sat, 30 Apr 2005 17:14:28 +0000 (17:14 +0000)
PR 14884
* Apply:
2004-03-25  Joseph S. Myers  <jsm@polyomino.org.uk>

* fixinc/inclhack.def (rpc_xdr_lvalue_cast_a,
rpc_xdr_lvalue_cast_b): New fixes.
* fixinc/tests/base/rpc/xdr.h: Add new tests.

From-SVN: r99040

gcc/ChangeLog
gcc/fixinc/inclhack.def
gcc/fixinc/tests/base/rpc/xdr.h

index b675b1cb2814836b405149e94cfd538f36c98c2e..72c575b41b3850cf4f5345bf277b8562a9cbdb49 100644 (file)
@@ -1,3 +1,13 @@
+2005-04-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       PR 14884
+       * Apply:
+       2004-03-25  Joseph S. Myers  <jsm@polyomino.org.uk>
+
+       * fixinc/inclhack.def (rpc_xdr_lvalue_cast_a,
+       rpc_xdr_lvalue_cast_b): New fixes.
+       * fixinc/tests/base/rpc/xdr.h: Add new tests.
+
 2005-04-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * Apply:
index 534a0b419c43fc05598ce93e5c724c0e8361debe..d62c12c00fad34f7f2ab0fc50a8d8c9f911f5146 100644 (file)
@@ -2276,6 +2276,31 @@ fix = {
 };
 
 
+/*
+ *  Fix casts as lvalues in glibc's <rpc/xdr.h>.
+ */
+fix = {
+    hackname  = rpc_xdr_lvalue_cast_a;
+    files     = rpc/xdr.h;
+    select    = "#define[ \t]*IXDR_GET_LONG.*\\\\\n.*__extension__.*";
+    c_fix     = format;
+    c_fix_arg = "#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))";
+    test_text = "#define IXDR_GET_LONG(buf) \\\\\n"
+                "\t((long)ntohl((u_long)*__extension__((u_int32_t*)(buf))++))";
+};
+
+
+fix = {
+    hackname  = rpc_xdr_lvalue_cast_b;
+    files     = rpc/xdr.h;
+    select    = "#define[ \t]*IXDR_PUT_LONG.*\\\\\n.*__extension__.*";
+    c_fix     = format;
+    c_fix_arg = "#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))";
+    test_text = "#define IXDR_PUT_LONG(buf, v) \\\\\n"
+                "\t(*__extension__((u_int32_t*)(buf))++ = (long)htonl((u_long)(v)))";
+};
+
+
 /*
  *  function class(double x) conflicts with C++ keyword on rs/6000
  */
index 69fc4c1f5cf6b994736156737d7bed81f0ef9875..7b9f9bae9618cc044e601f3b2ef0872c02eaa442 100644 (file)
@@ -9,6 +9,16 @@
 
 
 
+#if defined( RPC_XDR_LVALUE_CAST_A_CHECK )
+#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))
+#endif  /* RPC_XDR_LVALUE_CAST_A_CHECK */
+
+
+#if defined( RPC_XDR_LVALUE_CAST_B_CHECK )
+#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))
+#endif  /* RPC_XDR_LVALUE_CAST_B_CHECK */
+
+
 #if defined( STRUCT_FILE_CHECK )
 struct __file_s;
 extern void xdrstdio_create( struct __file_s* );