• Kirill Kolyshkin's avatar
    Silence clang-4 warning about unaligned pointer · 20a460fa
    Kirill Kolyshkin authored
    This is what we have:
    > compel/src/lib/infect.c:1145:38: error: taking address of packed member
    > 'uc_sigmask' of class or structure 'ucontext_ia32' may result in an
    > unaligned pointer value [-Werror,-Waddress-of-packed-member]
    >         blk_sigset = RT_SIGFRAME_UC_SIGMASK(f);
    >                      ~~~~~~~~~~~~~~~~~~~~~~~^~
    > compel/include/uapi/asm/sigframe.h:133:4: note: expanded from macro
    > 'RT_SIGFRAME_UC_SIGMASK'
    >         (&rt_sigframe->compat.uc.uc_sigmask))
    >           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    > 1 error generated.
    
    Indeed this results in an unaligned pointer, but as this is intended and
    well known (see commit dd6736bd "compel/x86/compat: pack ucontext_ia32"),
    we need to silence the warning here.
    
    For more details, see https://reviews.llvm.org/D20561
    
    Originally found by Travis on Alpine Linux, reproduced on Ubuntu 17.10.
    
    [v2: fix for non-x86]
    Reported-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    Signed-off-by: 's avatarKir Kolyshkin <kolyshkin@gmail.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    20a460fa
Name
Last commit
Last update
..
arch Loading commit data...
include Loading commit data...
plugins Loading commit data...
src Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
Makefile Loading commit data...
compel-host Loading commit data...