This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fixinc patch for rpc/xdr.h lvalue casts
- From: Bruce Korb <bkorb at veritas dot com>
- To: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 24 Mar 2004 18:53:09 -0800
- Subject: Re: fixinc patch for rpc/xdr.h lvalue casts
- Organization: Home
- References: <Pine.LNX.4.58.0403250050400.5195@digraph.polyomino.org.uk>
"Joseph S. Myers" wrote:
>
> Here is the corresponding fixincludes patch to the glibc patch
> stopping <rpc/xdr.h> from using casts as lvalues. Bootstrapped with
> no regressions on i686-pc-linux-gnu, checked it does fix old installed
> <rpc/xdr.h>, and passes fixinc "make check". OK to commit?
You did it all!! You're the man!
'course, I almost always have little suggestions:
> +/*
> + * Fix casts as lvalues in glibc's <rpc/xdr.h>.
> + */
> +fix = {
> + hackname = rpc_xdr_lvalue_cast;
> + files = rpc/xdr.h;
> + select = "#define[ \t]*IXDR_(GET|PUT)_LONG.*\\\\\n.*__extension__.*";
> + c_fix = format;
> + c_fix_arg = "#define IXDR_%1_LONG(buf) ((long)IXDR_%1_U_INT32(buf))";
> + test_text = "#define IXDR_GET_LONG(buf) \\\\\n"
> + "\t((long)ntohl((u_long)*__extension__((u_int32_t*)(buf))++))";
> +};
It is important to try to keep the test count down.
Cheers - Bruce