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

David Gibson david at gibson.dropbear.id.au
Fri Aug 15 13:00:33 EST 2014


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>

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/ccan/attachments/20140815/95082fec/attachment.sig>


More information about the ccan mailing list