Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1659080yba; Fri, 17 May 2019 03:09:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxy6YI2jM+caCBM9G9y99zvZWYbsoGSv/S0KV60LATDhYx/35a6eg237BjX+ytje9LPciHN X-Received: by 2002:a17:902:2b89:: with SMTP id l9mr57171121plb.331.1558087768840; Fri, 17 May 2019 03:09:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558087768; cv=none; d=google.com; s=arc-20160816; b=hEW0MwYWJU7VCEb47/viFjH6gTRMjcEzOTNJg6PTvXDXNUpOMMJ/kXqG7ofscLn1jt w5LCt/R2/FbsOWQ/NMzH/unGar25XWOtP1E2e3g1a/Imb58LRSi3jjcfQRJLywTsReNs ikSZJAeYbBBeRhqYhDKoI5vGplK5cUwNtR4YnFLkBHiC5Qhuw8LtkO2O5tV/OPCapK6j o+bnNvUBkk4Zv3c16sD3o6nySMeVDtDQqVPip5wrMc5RHKHrYy/zu7AacryJjkDlrykM ne8HSqDFhIHI2NLjopzAenQH7iDYhuFgBJfCP1OXofUF8beNRKXYtva263Cpk2hw4jBK w3zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=lHlMJPij7+17QUMN8OZlFj9YZ2d+7CK6eZOgsNtcr1E=; b=MUDI8dTfUXjIOnKLMyrmfVC9ZlWhj2VhjP1owAHCASOS9XSImTEeEyilXiJ+nizk0b Iz69qp1f1AkdAgR5jcYixTiTXbICewMP8wQPVcVfcdOv3s43yq49CcZMBKl8xX1UpSkN C5rFLwK3nnK6Go8j3lCjY4DmVP/+vkBvXHmY9O92oQNx2wLEjT0VcpUSWL77YY+C8ne1 PYE/nuFm9QT9FDHJj5D4uji4IoJJpDqwInAv7d8CKLj8jPcvCC8qtU6tkgYUwLUVyvkw kb3xbvXrgdNZtR6ejsCaZNRTkb3pTTEThXRD9Cles6WO2Pp65jklKsrTRFvZCJJR3/DO lCQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r23si7818930pgj.234.2019.05.17.03.09.13; Fri, 17 May 2019 03:09:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728335AbfEQJaK (ORCPT + 99 others); Fri, 17 May 2019 05:30:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39774 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727758AbfEQJaK (ORCPT ); Fri, 17 May 2019 05:30:10 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16E8D30ADC82; Fri, 17 May 2019 09:30:10 +0000 (UTC) Received: from xz-x1 (dhcp-15-205.nay.redhat.com [10.66.15.205]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 346D85D9C4; Fri, 17 May 2019 09:30:02 +0000 (UTC) Date: Fri, 17 May 2019 17:30:00 +0800 From: Peter Xu To: Thomas Huth Cc: Radim =?utf-8?B?S3LEjW3DocWZ?= , Paolo Bonzini , linux-kselftest@vger.kernel.org, kvm@vger.kernel.org, Shuah Khan , Andrew Jones , Vitaly Kuznetsov , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] KVM: selftests: Compile code with warnings enabled Message-ID: <20190517093000.GO16681@xz-x1> References: <20190517090445.4502-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190517090445.4502-1-thuth@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 17 May 2019 09:30:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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__) ^ 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. Thanks, -- Peter Xu