This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: soft-fp: Use parentheses around macro arguments
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 09 Oct 2014 19:35:49 +0200
- Subject: Re: soft-fp: Use parentheses around macro arguments
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1410091706070 dot 23641 at digraph dot polyomino dot org dot uk>
"Joseph S. Myers" <joseph@codesourcery.com> writes:
> diff --git a/soft-fp/double.h b/soft-fp/double.h
> index 1e6283e..36a11a5 100644
> --- a/soft-fp/double.h
> +++ b/soft-fp/double.h
> @@ -90,21 +90,21 @@ union _FP_UNION_D
> };
>
> # define FP_DECL_D(X) _FP_DECL (2, X)
> -# define FP_UNPACK_RAW_D(X, val) _FP_UNPACK_RAW_2 (D, X, val)
> -# define FP_UNPACK_RAW_DP(X, val) _FP_UNPACK_RAW_2_P (D, X, val)
> -# define FP_PACK_RAW_D(val, X) _FP_PACK_RAW_2 (D, val, X)
> +# define FP_UNPACK_RAW_D(X, val) _FP_UNPACK_RAW_2 (D, X, (val))
> +# define FP_UNPACK_RAW_DP(X, val) _FP_UNPACK_RAW_2_P (D, X, (val))
> +# define FP_PACK_RAW_D(val, X) _FP_PACK_RAW_2 (D, (val), X)
Why do you need that? Unless you play tricks with a macro expanding to
a comma it is impossible to put a literal comma in a macro argument
without hiding it inside parens.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."