lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8736ldquyw.fsf@vitty.brq.redhat.com>
Date:   Fri, 17 May 2019 11:41:11 +0200
From:   Vitaly Kuznetsov <vkuznets@...hat.com>
To:     Peter Xu <peterx@...hat.com>, Thomas Huth <thuth@...hat.com>
Cc:     Radim Krčmář <rkrcmar@...hat.com>,
        Paolo Bonzini <pbonzini@...hat.com>,
        linux-kselftest@...r.kernel.org, kvm@...r.kernel.org,
        Shuah Khan <shuah@...nel.org>,
        Andrew Jones <drjones@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled

Peter Xu <peterx@...hat.com> writes:

> On Fri, May 17, 2019 at 11:04:45AM +0200, Thomas Huth wrote:
>> So far the KVM selftests are compiled without any compiler warnings
>> enabled. That's quite bad, since we miss a lot of possible bugs this
>> way. Let's enable at least "-Wall" and some other useful warning flags
>> now, and fix at least the trivial problems in the code (like unused
>> variables).
>> 
>> Signed-off-by: Thomas Huth <thuth@...hat.com>
>> ---
>>  v2:
>>  - Rebased to kvm/queue
>>  - Fix warnings in state_test.c and evmcs_test.c, too
>
> I still see these warnings (probably because the hyperv_cpuid.c is a
> new test):
>
> In file included from x86_64/hyperv_cpuid.c:18:
> x86_64/hyperv_cpuid.c: In function ‘test_hv_cpuid’:
> x86_64/hyperv_cpuid.c:61:33: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses]
>    TEST_ASSERT(entry->padding[0] == entry->padding[1]
>                ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
> include/test_util.h:32:15: note: in definition of macro ‘TEST_ASSERT’
>   test_assert((e), #e, __FILE__, __LINE__, fmt, ##__VA_ARGS__)
>                ^
> x86_64/hyperv_cpuid.c:62:8: warning: suggest parentheses around comparison in operand of ‘==’ [-Wparentheses]
>    TEST_ASSERT(entry->padding[0] == entry->padding[1]
>                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>         == entry->padding[2] == 0,
>         ^~~~~~~~~~~~~~~~~~~~
> include/test_util.h:32:15: note: in definition of macro ‘TEST_ASSERT’
>   test_assert((e), #e, __FILE__, __LINE__, fmt, ##__VA_ARGS__)

There's a fix from Dan Carpenter on the list:
https://marc.info/?l=kernel-janitors&m=155783012012532&w=2

>                ^
> x86_64/hyperv_cpuid.c: In function ‘kvm_get_supported_hv_cpuid’:
> x86_64/hyperv_cpuid.c:93:6: warning: unused variable ‘ret’ [-Wunused-variable]
>   int ret;
>       ^~~
>
> The first two seem to be real bugs in the test code, and the 3rd one
> might need a cleanup too.

-- 
Vitaly

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ