This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix powerpc fpu_control.h namespace and parenthesis issues (bug 15966)
- From: "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 17 Sep 2013 12:01:52 -0500
- Subject: Re: Fix powerpc fpu_control.h namespace and parenthesis issues (bug 15966)
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1309171654470 dot 7957 at digraph dot polyomino dot org dot uk>
On Tue, Sep 17, 2013 at 11:57 AM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> While working on the e500 port, I noticed that the existing classic
> hard-float case in the powerpc fpu_control.h defined _FPU_GETCW and
> _FPU_SETCW in ways that are not namespace-clean (use identifiers "d",
> "cw" and "tmp" that are in the user's namespace and don't form part of
> the interface provided by this header) and fail to surround a use of
> the argument to _FPU_SETCW with parentheses. (The macros *did* use
> initial "__" on the parameter name, presumably to avoid conflict with
> the field called "cw", but that's exactly the wrong way around to do
> things; macro parameter names never interfere with the user's
> namespace.)
>
> This patch (untested) fixes these issues in the obvious way.
>
> 2013-09-17 Joseph Myers <joseph@codesourcery.com>
>
> [BZ #15966]
> * sysdeps/powerpc/fpu_control.h [!_SOFT_FLOAT && !__NO_FPRS__]
> (_FPU_GETCW): Use initial "__" on variable and field names but not
> on macro parameter name.
> [!_SOFT_FLOAT && !__NO_FPRS__] (_FPU_SETCW): Likewise. Use
> parentheses around reference to macro parameter.
Good catch. I'm fine with the patch.
Ryan