Re: linux-next: build failure after merge of the mac80211-next tree

From: Johannes Berg
Date: Wed Feb 24 2016 - 03:12:50 EST


Hi Stephen,

> [...]
> include/linux/bug.h:74:2: note: in expansion of macro
> 'BUILD_BUG_ON_MSG'
> Â BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
> Â ^
> net/rfkill/core.c:647:2: note: in expansion of macro 'BUILD_BUG_ON'
> Â BUILD_BUG_ON(!rfkill_types[NUM_RFKILL_TYPES - 1]);
> Â ^
>
> Caused by commit
>
> Â 1f86443b4ffe ("net: rfkill: add rfkill_find_type function")

Thanks for the heads-up.

> Maybe the compiler version matters?ÂÂI am using gcc v5.2.0.

Hm. I'm usingÂDebian 5.3.1-8.

> Though, it seems to be that "!rfkill_types[NUM_RFKILL_TYPES - 1]" is
> not a constant expression since
>
> static const char *rfkill_types[NUM_RFKILL_TYPES]
>
> does not stop "rfkill_types[NUM_RFKILL_TYPES - 1]" being modified at
> run time. I think that you might need:
>
> static const char * const rfkill_types[NUM_RFKILL_TYPES]

That's true, but since I can't test it I'll just solve this
differently. We'll never be able to insert anything into the middle, so
we can also just BUILD_BUG_ON() the ARRAY_SIZE() and do the code a bit
differently.

Thanks,
johannes