> Date: Sun, 2 Aug 2020 10:47:21 +0200
> From: Jarom�r Dole ek <jaromir.dole...@gmail.com>
> Readability first and foremost in this case.
> I was exploring if I can disable VLAs for the kernel altogether, this
> can't be done for now. Nevertheless, this change looked like it would
> be useful to make anyway.

Why does it improve readability?  Surely if we want the size of an
array of device_t of length n it's more to the point to say
sizeof(device_t[n]) directly than to talk about multiplying
sizeof(device_t) by n.  If that were the only question I think the
change makes readability worse, personally!

But it sounds like the original motivation is that it triggered
-Wvla...which frankly strikes me as a compiler bug since there's
obviously no actual VLA created in sizeof; as far as I can tell
there's no semantic difference between sizeof(device_t[n]) and
sizeof(device_t) * n.

What else does -Wvla choke on in src/sys?

Reply via email to