Fix powerpc fpu_control.h namespace and parenthesis issues (bug 15966)
Ryan S. Arnold
ryan.arnold@gmail.com
Tue Sep 17 17:01:00 GMT 2013
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
More information about the Libc-alpha
mailing list