[ccan] [PATCH] endian: Wrap arguments in braces to silence warnings

Rusty Russell rusty at rustcorp.com.au
Sat Aug 16 04:49:27 EST 2014


David Gibson <david at gibson.dropbear.id.au> writes:
> On Thu, Aug 14, 2014 at 01:37:53PM +1000, Joel Stanley wrote:
>> When using the endian swapping marcos with multiple arguments that are
>> or'd together:
>> 
>>   CPU_TO_BE64(THIS_THING | THAT_THING)
>> 
>> gcc will emit this warning:
>> 
>>   warning: suggest parentheses around arithmetic in operand
>>   of ‘|’ [-Wparentheses]
>> 
>> Wrap the arugments in braces to avoid this.
>> 
>> Signed-off-by: Joel Stanley <joel at jms.id.au>
>
> Brackets around macro arguments are always a good idea.
>
> Reviewed-by: David Gibson <david at gibson.dropbear.id.au>

Yerch, yes!

Applied!
Rusty.


More information about the ccan mailing list