This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fixinc patch for rpc/xdr.h lvalue casts


"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]