From: Joseph Myers Date: Wed, 7 Apr 2004 22:25:33 +0000 (+0100) Subject: inclhack.def (rpc_xdr_lvalue_cast_a, [...]): New fixes. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ed6a1b910b462fbc4b695272d54f3ee39ba991d;p=gcc.git inclhack.def (rpc_xdr_lvalue_cast_a, [...]): New fixes. * fixinc/inclhack.def (rpc_xdr_lvalue_cast_a, rpc_xdr_lvalue_cast_b): New fixes. * fixinc/fixincl.x: Regenerate. * fixinc/tests/base/rpc/xdr.h: Add new tests. From-SVN: r80490 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b91d799a191..34b8e14f890 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-04-07 Joseph S. Myers + + * fixinc/inclhack.def (rpc_xdr_lvalue_cast_a, + rpc_xdr_lvalue_cast_b): New fixes. + * fixinc/fixincl.x: Regenerate. + * fixinc/tests/base/rpc/xdr.h: Add new tests. + 2004-04-07 David Edelsohn * config/rs6000/rs6000.c (processor_target_table): Add MASK_MFCRF diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x index 620c934be8f..f3a1149dce1 100644 --- a/gcc/fixinc/fixincl.x +++ b/gcc/fixinc/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Thursday January 22, 2004 at 08:36:55 PM MET + * It has been AutoGen-ed Wednesday April 7, 2004 at 10:23:41 PM UTC * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Jan 22 20:36:56 MET 2004 +/* DO NOT CVS-MERGE THIS FILE, EITHER Wed Apr 7 22:23:41 UTC 2004 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 172 fixup descriptions. + * This file contains 174 fixup descriptions. * * See README for more information. * @@ -4017,6 +4017,78 @@ static const char* apzRead_Ret_TypePatch[] = { "(extern int\t.*), fread\\(\\), fwrite\\(\\)(.*)", (char*)NULL }; +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Rpc_Xdr_Lvalue_Cast_A fix + */ +tSCC zRpc_Xdr_Lvalue_Cast_AName[] = + "rpc_xdr_lvalue_cast_a"; + +/* + * File name selection pattern + */ +tSCC zRpc_Xdr_Lvalue_Cast_AList[] = + "|rpc/xdr.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzRpc_Xdr_Lvalue_Cast_AMachs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zRpc_Xdr_Lvalue_Cast_ASelect0[] = + "#define[ \t]*IXDR_GET_LONG.*\\\\\n\ +.*__extension__.*"; + +#define RPC_XDR_LVALUE_CAST_A_TEST_CT 1 +static tTestDesc aRpc_Xdr_Lvalue_Cast_ATests[] = { + { TT_EGREP, zRpc_Xdr_Lvalue_Cast_ASelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Rpc_Xdr_Lvalue_Cast_A + */ +static const char* apzRpc_Xdr_Lvalue_Cast_APatch[] = { + "format", + "#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf))", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Description of Rpc_Xdr_Lvalue_Cast_B fix + */ +tSCC zRpc_Xdr_Lvalue_Cast_BName[] = + "rpc_xdr_lvalue_cast_b"; + +/* + * File name selection pattern + */ +tSCC zRpc_Xdr_Lvalue_Cast_BList[] = + "|rpc/xdr.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzRpc_Xdr_Lvalue_Cast_BMachs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zRpc_Xdr_Lvalue_Cast_BSelect0[] = + "#define[ \t]*IXDR_PUT_LONG.*\\\\\n\ +.*__extension__.*"; + +#define RPC_XDR_LVALUE_CAST_B_TEST_CT 1 +static tTestDesc aRpc_Xdr_Lvalue_Cast_BTests[] = { + { TT_EGREP, zRpc_Xdr_Lvalue_Cast_BSelect0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Rpc_Xdr_Lvalue_Cast_B + */ +static const char* apzRpc_Xdr_Lvalue_Cast_BPatch[] = { + "format", + "#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v)))", + (char*)NULL }; + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * Description of Rs6000_Double fix @@ -6822,9 +6894,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 193 +#define REGEX_COUNT 195 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 172 +#define FIX_COUNT 174 /* * Enumerate the fixes @@ -6929,6 +7001,8 @@ typedef enum { OSF_NAMESPACE_C_FIXIDX, PTHREAD_PAGE_SIZE_FIXIDX, READ_RET_TYPE_FIXIDX, + RPC_XDR_LVALUE_CAST_A_FIXIDX, + RPC_XDR_LVALUE_CAST_B_FIXIDX, RS6000_DOUBLE_FIXIDX, RS6000_FCHMOD_FIXIDX, RS6000_PARAM_FIXIDX, @@ -7500,6 +7574,16 @@ tFixDesc fixDescList[ FIX_COUNT ] = { READ_RET_TYPE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aRead_Ret_TypeTests, apzRead_Ret_TypePatch, 0 }, + { zRpc_Xdr_Lvalue_Cast_AName, zRpc_Xdr_Lvalue_Cast_AList, + apzRpc_Xdr_Lvalue_Cast_AMachs, + RPC_XDR_LVALUE_CAST_A_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aRpc_Xdr_Lvalue_Cast_ATests, apzRpc_Xdr_Lvalue_Cast_APatch, 0 }, + + { zRpc_Xdr_Lvalue_Cast_BName, zRpc_Xdr_Lvalue_Cast_BList, + apzRpc_Xdr_Lvalue_Cast_BMachs, + RPC_XDR_LVALUE_CAST_B_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aRpc_Xdr_Lvalue_Cast_BTests, apzRpc_Xdr_Lvalue_Cast_BPatch, 0 }, + { zRs6000_DoubleName, zRs6000_DoubleList, apzRs6000_DoubleMachs, RS6000_DOUBLE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def index 78dda4b8dbb..086b8c0d420 100644 --- a/gcc/fixinc/inclhack.def +++ b/gcc/fixinc/inclhack.def @@ -2229,6 +2229,31 @@ fix = { }; +/* + * Fix casts as lvalues in glibc's . + */ +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 */ 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* );