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

From: Martti Kühne <>
Date: Tue, 22 Apr 2014 21:25:25 +0200

On Sun, Apr 20, 2014 at 9:24 PM, Rob <> wrote:
> Into the bikeshed I go...
> LEN(a + 2) doesn't mean anything anyway, as a's type decays.
> To do it properly there should be some kind of static assert in the
> macro that the argument is of array type. But this is a small code base
> and you'd expect that the code would be run and checked before
> committing, which renders the assert pretty useless.
> I think it's fine as it is, in the original C way of doing things,
> garbage in, garbage out, undefined behaviour etc etc.
> Rob

I may remind you there is the case where people make struct
concatenations, just because they can. Arrays of concatenated structs.
The cases where you don't even care when the preprocessor will append
a pointer or a size_t to your type. You don't even want to know.

So, no, the parentheses are not just needed for style.

Which we require therefore.

Thanks for your time.

Received on Tue Apr 22 2014 - 21:25:25 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 22 2014 - 21:36:06 CEST