This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [PATCH][BINUTILS][AARCH64] Add support for pointer authentication B key


Hi Sam,

>> One thing did catch my eye:
>>
>> +#define tc_output_cie_extra(cie) if (cie->pauth_key == AARCH64_PAUTH_KEY_B) \
>> +			      out_one ('B');
>>
>> Normally this would be written as:
>>
>> #define tc_output_cie_extra(cie) \
>>    do \
>>      { \
>>        if (cie->pauth_key == AARCH64_PAUTH_KEY_B) \
>>          out_one ('B'); \
>>      } \
>>    while (0)
>>
>> (Note - no semi-colon at the end).

> That's an interesting convention! I don't really see the use of the loop.

It is there so that programmers can do:

  if (foo)
    tc_output_cie_extra (bar);
  if (baz)
     blah;

With your version you might get a warning from the compiler about the "if (baz)"
conditional not being clearly associated with a previous if() statement.

> I can commit this with the convention if you'd like, otherwise I can get 
> it committed right away.

I think that I prefer my way. :-)  Sorry, but your patch is still approved with this change made.

Cheers
  Nick



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