Saleem Abdulrasool <compn...@compnerd.org> writes:

> On Saturday, October 3, 2015, Andreas Schwab <sch...@linux-m68k.org> wrote:
>
>> Saleem Abdulrasool <compn...@compnerd.org <javascript:;>> writes:
>>
>> > For ARM EHABI _Unwind_{G,S}setIP are macros rather than proper functions
>> as they
>> > are extensions to the EHABI specification (though they are part of the
>> Level 1
>> > interface).  Quote the macro parameters, as otherwise, a complex
>> parameter may
>> > be ambiguously mis-expanded.
>> > ---
>> >  libgcc/config/arm/unwind-arm.h | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/libgcc/config/arm/unwind-arm.h
>> b/libgcc/config/arm/unwind-arm.h
>> > index f1f789c..3821c08 100644
>> > --- a/libgcc/config/arm/unwind-arm.h
>> > +++ b/libgcc/config/arm/unwind-arm.h
>> > @@ -74,10 +74,10 @@ extern "C" {
>> >      }
>> >    /* Return the address of the instruction, not the actual IP value.  */
>> >  #define _Unwind_GetIP(context) \
>> > -  (_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
>> > +  (_Unwind_GetGR ((context), 15) & ~(_Unwind_Word)1)
>>
>> How can that get mis-expanded (other than cheating with a macro that
>> expands to a comma)?
>>
>
> Poor choice of words on my part.  It won't mis-expand, it may expand into
> an "ambiguous" statement (which will be diagnosed with a warning) if the
> argument is an expression in the sense of:
>
> a + b | 1

That cannot happen here, unless the caller already passes such an
expression.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to