Hi!

On Mon, 2026-10-26 at 11:39:56 +0100, Samuel Thibault wrote:
> But I don't think we need MAX_DISK_DEV at all: you can just drop the
> size from the allowed_devs array so it's automatically computed, and
> make the for loop use sizeof(allowed_devs)/sizeof(allowed_devs[0]) to
> know how many elements there are in the array. That can be a preparatory
> patch that we can commit already.

It seems gnumach already has an ARRAY_SIZE macro, so I'd use that.

Although I think ideally the code base could be switched to use
countof() (from the upcoming C2y standard) found in <stdcountof.h>.
And the preparatory patch would rename ARRAY_SIZE to to countof, making
it visible only if it's not already provided by the libc/compiler, and
then have an ARRAY_SIZE that uses countof for backwards compat for the
existing code until that has been migrated?

It's not clear what's the stance on using such headers (if available)
from libc (I see usage of <stdint.h> already for example).

Thanks,
Guillem

Reply via email to