diff options
author | Gabriel Dos Reis <gdr@integrable-solutions.net> | 2005-04-30 17:14:28 +0000 |
---|---|---|
committer | Gabriel Dos Reis <gdr@integrable-solutions.net> | 2005-04-30 17:14:28 +0000 |
commit | d64234b42fde23d17d2bbdb0e14b8a7bb0ed2484 (patch) | |
tree | 29e82cb24db342fa1e0bed9bc0cd19084f914b98 | |
parent | 496e4007f4b4c447b54899185eaab53cea3bae15 (diff) |
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.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-3_3-branch@99040 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/fixinc/inclhack.def | 25 | ||||
-rw-r--r-- | gcc/fixinc/tests/base/rpc/xdr.h | 10 |
3 files changed, 45 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b675b1cb281..72c575b41b3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,15 @@ 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: 2004-10-21 Aldy Hernandez <aldyh@redhat.com> diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 534a0b419c4..d62c12c00fa 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -2277,6 +2277,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 */ fix = { diff --git a/gcc/fixinc/tests/base/rpc/xdr.h b/gcc/fixinc/tests/base/rpc/xdr.h index 69fc4c1f5cf..7b9f9bae961 100644 --- a/gcc/fixinc/tests/base/rpc/xdr.h +++ b/gcc/fixinc/tests/base/rpc/xdr.h @@ -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* ); |