]> git.baikalelectronics.ru Git - kernel.git/commit
objtool: Allow nested externs to enable BUILD_BUG()
authorVasily Gorbik <gor@linux.ibm.com>
Mon, 5 Oct 2020 15:50:28 +0000 (17:50 +0200)
committerJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 6 Oct 2020 14:32:13 +0000 (09:32 -0500)
commit22c5bd37c9f918824ee03da45776a29176fd5be2
tree13ad1994cbfcc1028638cf0133b64e70c6958d94
parentfd4647c065e965edc6d36cd2916abf36f5d23957
objtool: Allow nested externs to enable BUILD_BUG()

Currently BUILD_BUG() macro is expanded to smth like the following:
   do {
           extern void __compiletime_assert_0(void)
                   __attribute__((error("BUILD_BUG failed")));
           if (!(!(1)))
                   __compiletime_assert_0();
   } while (0);

If used in a function body this obviously would produce build errors
with -Wnested-externs and -Werror.

Build objtool with -Wno-nested-externs to enable BUILD_BUG() usage.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
tools/objtool/Makefile