From nobody Mon Apr 29 02:05:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1598970576; cv=none; d=zohomail.com; s=zohoarc; b=MUIV9f7HBoOiTyiICM/9mMLLfr01ACoIPDqW29xpUw2WXftnoBIb42ESTpuOk3z2+VHOEoRab8fdMIDJfZ0MJkIGURJhBby7ItD/bLFWv8Wc2cnxI4G+4iYHo47pcAB1zfNTDXE8m8xEBdZ1RatcXyykyUHzMHudHCdTGsUF5rg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1598970576; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=2MDb61qSE8d6nPJDP5XBYcT1+MQJMw+3o9UR4+MuYUg=; b=ibaQ7JPHIBc3qz3E18apmDRNjFkz9DtF19nBSlnusBdowGVe09cU8SUhl8vUZfcFy+JMFMT1bV/KZkrafQg0sZq913ETVGnjPdTnQrt9woFjFxLp7YE5pVPxG/LdbjZLlrjJyFHn8sr3wKIm9coBR4IkJI6VYEd+NUVE2Qeinz4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1598970576220401.6845639945094; Tue, 1 Sep 2020 07:29:36 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-171-BYlJzzYuMWm7OYKiofrjDA-1; Tue, 01 Sep 2020 10:08:15 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 20CAB10ABDA8; Tue, 1 Sep 2020 14:08:09 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7215660BE2; Tue, 1 Sep 2020 14:08:08 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3A0D27A2E7; Tue, 1 Sep 2020 14:08:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 081E85OR014063 for ; Tue, 1 Sep 2020 10:08:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id C74B860BE2; Tue, 1 Sep 2020 14:08:05 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 448A561177 for ; Tue, 1 Sep 2020 14:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598970573; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=2MDb61qSE8d6nPJDP5XBYcT1+MQJMw+3o9UR4+MuYUg=; b=CqXJHAHY6yKFV9iLv0ntSPI7I+V7+/GREKTgzkc+nlLaon2SS5zyuWodgdTLxS0wJMplDJ yIzG6zu9nsA7WKkqGyQYAKapUTp+yOHvuOA/E8CDKEEIpkLz2C6dIrsljQxofCMsCZXJqc 9+nAZG5eosWidx/hsrV44F9/c6w/j/M= X-MC-Unique: BYlJzzYuMWm7OYKiofrjDA-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH] meson: add -Wall and -Wextra explicitly for buildtype=plain Date: Tue, 1 Sep 2020 16:08:04 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If someone runs `meson setup --buildtype plain` meson ignores warning_level=3D2 that is in our meson.build file. The implication is that Meson will not automatically add -Wall which enables -Wformat. This breaks building libvirt from git with the buildtype set to plain. There is an issue reported [1] to not ignore warning_level silently and the change to ignore it was done by upstream commit [2]. [1] [2] Signed-off-by: Pavel Hrdina --- meson.build | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index e193166a9b..f38785eeae 100644 --- a/meson.build +++ b/meson.build @@ -503,10 +503,6 @@ cc_flags_disabled =3D [ # In meson this is specified using 'c_std=3Dgnu99' in project() function. '-std=3Dgnu99', =20 - # In meson this is specified using 'warning_level=3D2' in project() func= tion. - '-Wall', - '-Wextra', - # don't care about C++ compiler compat '-Wc++-compat', '-Wabi', @@ -573,6 +569,21 @@ cc_flags_disabled =3D [ '-Wsuggest-attribute=3Dmalloc', ] =20 +# In meson this is specified using 'warning_level=3D2' in project() functi= on. +# However, meson silently ignores 'warning_level' option with 'buildtype= =3Dplain' +# so we have to enable them explicitly. +if get_option('buildtype') =3D=3D 'plain' + cc_flags +=3D [ + '-Wall', + '-Wextra', + ] +else + cc_flags_disabled +=3D [ + '-Wall', + '-Wextra', + ] +endif + foreach flag : cc_flags_disabled if cc_flags.contains(flag) error('@0@ is disabled but listed in cc_flags'.format(flag)) --=20 2.26.2