Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1341213 > unrolled thread

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

Started byStephen Rothwell <sfr@canb.auug.org.au>
First post2016-02-24 02:00 +0100
Last post2016-02-24 09:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  linux-next: build failure after merge of the mac80211-next tree Stephen Rothwell <sfr@canb.auug.org.au> - 2016-02-24 02:00 +0100
    Re: linux-next: build failure after merge of the mac80211-next tree Johannes Berg <johannes@sipsolutions.net> - 2016-02-24 09:20 +0100

#1341213 — linux-next: build failure after merge of the mac80211-next tree

FromStephen Rothwell <sfr@canb.auug.org.au>
Date2016-02-24 02:00 +0100
Subjectlinux-next: build failure after merge of the mac80211-next tree
Message-ID<r5vY6-54n-9@gated-at.bofh.it>
Hi Johannes,

After merging the mac80211-next tree, today's linux-next build (x86_64
allmodconfig) failed like this:

In file included from include/linux/linkage.h:4:0,
                 from include/linux/kernel.h:6,
                 from net/rfkill/core.c:20:
net/rfkill/core.c: In function 'rfkill_find_type':
include/linux/compiler.h:501:38: error: call to '__compiletime_assert_647' declared with attribute error: BUILD_BUG_ON failed: !rfkill_types[NUM_RFKILL_TYPES - 1]
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
                                      ^
include/linux/compiler.h:484:4: note: in definition of macro '__compiletime_assert'
    prefix ## suffix();    \
    ^
include/linux/compiler.h:501:2: note: in expansion of macro '_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
include/linux/bug.h:50:37: note: in expansion of macro 'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                     ^
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")

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

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]

I have used the mac80211-next from next-20160223 for today.

-- 
Cheers,
Stephen Rothwell

[toc] | [next] | [standalone]


#1341633

FromJohannes Berg <johannes@sipsolutions.net>
Date2016-02-24 09:20 +0100
Message-ID<r5CPU-1G8-7@gated-at.bofh.it>
In reply to#1341213
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web