]> git.ipfire.org Git - thirdparty/linux.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)
commit2486baae2cf6df73554144d0a4e40ae8809b54d4
tree13ad1994cbfcc1028638cf0133b64e70c6958d94
parentb0b8e56b82c06b3bb6e5fb66d0e9c9c3fd3ce555
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