Re: [dev] [st] [patch] misplaced parenthesis in LEN macro

From: Balazs Kezes <rlblaster_AT_gmail.com>
Date: Sun, 20 Apr 2014 15:04:43 +0100

On 2014-04-20 14:43 +0200, FRIGN wrote:
> However, I don't see any error in the way it was done before noname
> suggested changing it.

It's a common practice in C macros to enclose each argument instance
with parentheses to avoid most pitfalls. This particular case will most
probably be fine without the fix, it's just very annoying to read it
because it doesn't conform to that common practice. :)

Also, interesting sidenote: most bigger projects also have extra hacks
to make sure you cannot pass it a pointer. You can search for
discussions around "ARRAY_SIZE" for studying all the reasons for that
but probably you'll want to avoid this here to keep things simple.

-- 
Balazs
Received on Sun Apr 20 2014 - 16:04:43 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 20 2014 - 16:12:06 CEST