• John Hubbard's avatar
    selftests/lib.mk: silence some clang warnings that gcc already ignores · a84a0c6a
    John Hubbard authored
    
    
    gcc defaults to silence (off) for the following warnings, but clang
    defaults to the opposite. The warnings are not useful for the kernel
    itself, which is why they have remained disabled in gcc for the main
    kernel build. And it is only due to including kernel data structures in
    the selftests, that we get the warnings from clang.
    
        -Waddress-of-packed-member
        -Wgnu-variable-sized-type-not-at-end
    
    In other words, the warnings are not unique to the selftests: there is
    nothing that the selftests' code does that triggers these warnings,
    other than the act of including the kernel's data structures. Therefore,
    silence them for the clang builds as well.
    
    This eliminates warnings for the net/ and user_events/ kselftest
    subsystems, in these files:
    
        ./net/af_unix/scm_rights.c
        ./net/timestamping.c
        ./net/ipsec.c
        ./user_events/perf_test.c
    
    Cc: Nathan Chancellor <nathan@kernel.org>
    Signed-off-by: default avatarJohn Hubbard <jhubbard@nvidia.com>
    Acked-by: default avatarNathan Chancellor <nathan@kernel.org>
    Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
    a84a0c6a
lib.mk 7.74 KB