From nobody Fri Apr 26 08:42:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1617879520; cv=none; d=zohomail.com; s=zohoarc; b=QGPLshnJSvBR0Bqe557O9yq09W+hz/6UuQiy6cIF13yWsk9eBCo/LQHKN7HT6nswR8k5zhUrJSgq4QyKhPAVTtLqUwNAjRJZoPoharcgRZm8ngwA5AywNNNwgJBBHoSVReehbTOobQSVr563XXaKU+qAXAlQP/p4B4bu/tGRwaQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617879520; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=N+UHSTX/DwaVu0DrSa+Py8VBYC5P4Smw7Uskuahc+jw=; b=QSCbn9M7TOsscTm2hDIRgSFBcKxWyV1ClFvoHVe3fBv6O+xbbnwODeIQBR0/AY3WMxUb7EE+tN0ig7lJrbC7Jl+E++eNLDD15LUvq764rZggyTJ9b31dNBE0rOnNWWJclVuUY2wmvzuR4l0XGF0lVrgJ4S2GRU4PnTWqKackteM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1617879520709272.99569139157234; Thu, 8 Apr 2021 03:58:40 -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-110-_VUVBICUMAuZpeVh56EGbw-1; Thu, 08 Apr 2021 06:58:36 -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 0AF4110053E6; Thu, 8 Apr 2021 10:58:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DC41560C0F; Thu, 8 Apr 2021 10:58:31 +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 9A8891806D06; Thu, 8 Apr 2021 10:58:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 138AwTrM006207 for ; Thu, 8 Apr 2021 06:58:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C1141037EBD; Thu, 8 Apr 2021 10:58:29 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-81.ams2.redhat.com [10.36.115.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4A6410013D7; Thu, 8 Apr 2021 10:58:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617879519; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=N+UHSTX/DwaVu0DrSa+Py8VBYC5P4Smw7Uskuahc+jw=; b=FKWaa+T9t2HQgQXItLy8Wt4TMdQ9hF68k90JrXb5jT5o98Y0/vmcT5ERat4Oyh6fVkLExt 6YMwVl6uGu1G40MOcceRUITHeksufFSxLM/AAKIsgu1/cV7jOkc9+v0crvyE1K5nphSkdQ RiVWsm4k84pY/N74r/AacJGxPvx6oTY= X-MC-Unique: _VUVBICUMAuZpeVh56EGbw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/6] meson: get rid of list of unused warning flags Date: Thu, 8 Apr 2021 11:58:18 +0100 Message-Id: <20210408105823.462584-2-berrange@redhat.com> In-Reply-To: <20210408105823.462584-1-berrange@redhat.com> References: <20210408105823.462584-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) We're not using these warning flags with libvirt, and it is not worth keeping them just to issue a warning if someone tries to enable them. If someone does try to enable them, either libvirt will build cleanly or it won't. Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 76 ----------------------------------------------------- 1 file changed, 76 deletions(-) diff --git a/meson.build b/meson.build index b827bd9275..7565eace17 100644 --- a/meson.build +++ b/meson.build @@ -491,82 +491,6 @@ if not cc.compiles(w_unused_function_code, args: w_unu= sed_function_args) cc_flags +=3D ['-Wno-unused-function'] endif =20 -cc_flags_disabled =3D [ - # In meson this is specified using 'c_std=3Dgnu99' in project() function. - '-std=3Dgnu99', - - # don't care about C++ compiler compat - '-Wc++-compat', - '-Wabi', - '-Wdeprecated', - - # Don't care about ancient C standard compat - '-Wtraditional', - '-Wtraditional-conversion', - - # Ignore warnings in /usr/include - '-Wsystem-headers', - - # Happy for compiler to add struct padding - '-Wpadded', - - # GCC very confused with -O2 - '-Wunreachable-code', - - # Too many to deal with - '-Wconversion', - '-Wsign-conversion', - - # Need to allow bad cast for execve() - '-Wcast-qual', - - # We need to use long long in many places - '-Wlong-long', - - # We allow manual list of all enum cases without default - '-Wswitch-default', - - # Not a problem since we don't use -fstrict-overflow - '-Wstrict-overflow', - - # Not a problem since we don't use -funsafe-loop-optimizations - '-Wunsafe-loop-optimizations', - - # gcc 4.4.6 complains this is C++ only; gcc 4.7.0 implies this from -Wall - '-Wenum-compare', - - # gcc 5.1 -Wformat-signedness mishandles enums, not ready for prime time - '-Wformat-signedness', - - # Several conditionals expand the same on both branches depending on the - # particular platform/architecture - '-Wduplicated-branches', - - # > This warning does not generally indicate that there is anything wrong - # > with your code; it merely indicates that GCC's optimizers are unable - # > to handle the code effectively. - # Source: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html - '-Wdisabled-optimization', - - # Various valid glib APIs/macros trigger this warning - '-Wbad-function-cast', - - # We might fundamentally need some of these disabled forever, but - # ideally we'd turn many of them on - '-Wfloat-equal', - '-Wpacked', - '-Wunused-macros', - '-Woverlength-strings', - '-Wstack-protector', - '-Wsuggest-attribute=3Dmalloc', -] - -foreach flag : cc_flags_disabled - if cc_flags.contains(flag) - error('@0@ is disabled but listed in cc_flags'.format(flag)) - endif -endforeach - supported_cc_flags =3D cc.get_supported_arguments(cc_flags) add_project_arguments(supported_cc_flags, language: 'c') =20 --=20 2.30.2 From nobody Fri Apr 26 08:42:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1617879523; cv=none; d=zohomail.com; s=zohoarc; b=EaI12CpI0Tdl/GbIYHqjVCpAibfKIzQ70fY3Px8JjrGVfJWuW3UZjg08z08eMG4w04wc8imRpuNco1zgzqG7hduosU9tusjf2HVggh79O/G61w5tiBja4XcgMf2UDnTa1+RYpCkQcmDT+VJZuapVhfsDar8ASThr9uKkUSTd2o8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617879523; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Zrs1NYyGu0nKaLWHXoluMxsWMfV//JSAgUT2ovEIaWg=; b=EROIgkJ/gI0y0YODIURQo7GvIdaiJBMwvLnr0GP+kW25/ipOOU70/31u/7mpXY9FaZyn20NzLY+aUe8zWM/SstoKR89dIDZ/nJiYzzEAvAW7K/i9gUYKAj6Wov01V4N85xnn6wT55boY+cjNDbh1FEbzbeP8OR43uw/SJ3UYJ7Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617879523824868.8995403631067; Thu, 8 Apr 2021 03:58:43 -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-597-eyKxt-hsM8Cp76P_EPknGw-1; Thu, 08 Apr 2021 06:58:40 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id E94D091272; Thu, 8 Apr 2021 10:58:34 +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 C2B305D9CC; Thu, 8 Apr 2021 10:58:34 +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 841F655348; Thu, 8 Apr 2021 10:58:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 138AwUPO006218 for ; Thu, 8 Apr 2021 06:58:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id B2CBE10016FD; Thu, 8 Apr 2021 10:58:30 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-81.ams2.redhat.com [10.36.115.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id DBE4D10013D7; Thu, 8 Apr 2021 10:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617879522; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Zrs1NYyGu0nKaLWHXoluMxsWMfV//JSAgUT2ovEIaWg=; b=bSfyYUR/aGR2R6hULKPzVp8g83WT2iCrzGnH4k9spmV2ZzbOfxeFD55pdsub9vi74Y8NY/ ZAXZvOIenFEvKtJpQh5qwvB/HyJek2E5epe3UfxuLE5XgEQF/Ul7YqPUKSzTXqa7jGTF1M uqdF97xMB8uUX6GDGYvujKOvPhBU8Dc= X-MC-Unique: eyKxt-hsM8Cp76P_EPknGw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/6] meson: actually check for -Wframe-larger-than Date: Thu, 8 Apr 2021 11:58:19 +0100 Message-Id: <20210408105823.462584-3-berrange@redhat.com> In-Reply-To: <20210408105823.462584-1-berrange@redhat.com> References: <20210408105823.462584-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) All other warning flags are checked for compiler support, so we shouldn't blindly assume this one always exists. Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 7565eace17..97d9c52165 100644 --- a/meson.build +++ b/meson.build @@ -499,10 +499,12 @@ if cc.has_argument('-Wsuggest-attribute=3Dformat') endif =20 # used in tests -cc_flags_relaxed_frame_limit =3D [ +cc_flags_relaxed_frame_limit =3D [] +if cc.has_argument('-Wframe-larger-than=3D262144') + cc_flags_relaxed_frame_limit +=3D [ '-Wframe-larger-than=3D262144', -] - + ] +endif =20 # various linker checks =20 --=20 2.30.2 From nobody Fri Apr 26 08:42:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1617879525; cv=none; d=zohomail.com; s=zohoarc; b=QVcNk3vk3m/ZKFTH/klReaXtWiHk0uhvN18l5fxaeR0YFXr00YOhiBdl7TDMhicbeIH/8SzNXBG7xRCfHM8dJ2a5rMjwElyWUBNQ+JtIf5EG/1uwxYhTYm2vObjVeZNIX1IlH5JzxCLuZbgY24xsUnsf/QrsFXGSYiZymFNFWXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617879525; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=E9ugXfsJtwSzKst3R1gVaakzGvHhHwnOx3Y1Op5wfkE=; b=VDVyoGMnwRT8UeMj07c/3OIRU/kzzeAoBq9HQc0l+JnQi9WvRVwW8f/2b7j6wxaoltSpzTZNLUbgtiNskCl4lYfuopHtuwnyeTCrFoysxV7Ta10Db4xvkHQJnLBIPR0mp/3w700mbx1EMNVaqjb4yxALFEcggTyKxe4FbCUV6D0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 161787952545473.53297885561062; Thu, 8 Apr 2021 03:58:45 -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-551-b59T5JR1PAWLc_0X5Mv9zQ-1; Thu, 08 Apr 2021 06:58:41 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F4046107ACE3; Thu, 8 Apr 2021 10:58:35 +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 CE3B45C1C4; Thu, 8 Apr 2021 10:58:35 +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 978235534B; Thu, 8 Apr 2021 10:58:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 138AwVD3006234 for ; Thu, 8 Apr 2021 06:58:32 -0400 Received: by smtp.corp.redhat.com (Postfix) id EB35B1037EBD; Thu, 8 Apr 2021 10:58:31 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-81.ams2.redhat.com [10.36.115.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F16610013D7; Thu, 8 Apr 2021 10:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617879524; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=E9ugXfsJtwSzKst3R1gVaakzGvHhHwnOx3Y1Op5wfkE=; b=F+ECIxhwWf7gPvAuotK+TsmzHBZWV6lu7i4THebVxDeg8SvJOhkNi7JSh2ukTHElZHtwRg PPaoI6GNhJhHcQprbaVQbZ0KDZKn/fWdRLdS/crtbxAcRKVqO04XV9SpfDiLbBuqQWyhqB 02qUPRsMZ3JVUnHkU8wOclF21W1JxE4= X-MC-Unique: b59T5JR1PAWLc_0X5Mv9zQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/6] meson: merge all cc_flags arrays into one Date: Thu, 8 Apr 2021 11:58:20 +0100 Message-Id: <20210408105823.462584-4-berrange@redhat.com> In-Reply-To: <20210408105823.462584-1-berrange@redhat.com> References: <20210408105823.462584-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The split of arrays is fairly arbitrary and a hang over from the way we had to structure lists of flags when we used GNULIB's compiler flag checking m4 logic. The separate lists leads to cases where we enable a flag in one list and have contradictory setting in another list, which leads to confusion. Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 116 +++++++++++++++++++--------------------------------- 1 file changed, 43 insertions(+), 73 deletions(-) diff --git a/meson.build b/meson.build index 97d9c52165..55dde6d963 100644 --- a/meson.build +++ b/meson.build @@ -211,7 +211,23 @@ if git_werror.enabled() or git_werror.auto() and git cc_flags +=3D [ '-Werror' ] endif =20 + +# gcc --help=3Dwarnings outputs +ptrdiff_max =3D cc.sizeof('ptrdiff_t', prefix: '#include ') +size_max =3D cc.sizeof('size_t', prefix: '#include ') +# Compute max safe object size by checking ptrdiff_t and size_t sizes. +# Ideally we would get PTRDIFF_MAX and SIZE_MAX values but it would +# give us (2147483647L) and we would have to remove the () and the suffix +# in order to convert it to numbers to be able to pick the smaller one. +alloc_max =3D run_command( + 'python3', '-c', + 'print(min(2**(@0@ * 8 - 1) - 1, 2**(@1@ * 8) - 1))'.format(ptrdiff_max,= size_max), +) + cc_flags +=3D [ + '-fasynchronous-unwind-tables', + '-fexceptions', + '-fipa-pure-const', '-fno-common', '-W', '-Wabsolute-value', @@ -219,6 +235,9 @@ cc_flags +=3D [ '-Waddress-of-packed-member', '-Waggressive-loop-optimizations', '-Wall', + '-Walloc-size-larger-than=3D@0@'.format(alloc_max.stdout().strip()), + '-Warray-bounds=3D2', + '-Wattribute-alias=3D2', '-Wattribute-warning', '-Wattributes', '-Wbool-compare', @@ -228,7 +247,8 @@ cc_flags +=3D [ '-Wcannot-profile', '-Wcast-align', '-Wcast-align=3Dstrict', - '-Wcast-function-type', + # We do "bad" function casts all the time for event callbacks + '-Wno-cast-function-type', '-Wchar-subscripts', '-Wclobbered', '-Wcomment', @@ -251,17 +271,24 @@ cc_flags +=3D [ '-Wextra', '-Wformat-contains-nul', '-Wformat-extra-args', - '-Wformat-nonliteral', + # -Wformat=3D2 implies -Wformat-nonliteral so we need to manually exclud= e it + '-Wno-format-nonliteral', + '-Wformat-overflow=3D2', '-Wformat-security', + # -Wformat enables this by default, and we should keep it, + # but need to rewrite various areas of code first + '-Wno-format-truncation', '-Wformat-y2k', '-Wformat-zero-length', '-Wframe-address', + '-Wframe-larger-than=3D4096', '-Wfree-nonheap-object', '-Whsa', '-Wif-not-aligned', '-Wignored-attributes', '-Wignored-qualifiers', '-Wimplicit', + '-Wimplicit-fallthrough=3D5', '-Wimplicit-function-declaration', '-Wimplicit-int', '-Wincompatible-pointer-types', @@ -272,6 +299,7 @@ cc_flags +=3D [ '-Wint-to-pointer-cast', '-Winvalid-memory-model', '-Winvalid-pch', + '-Wjump-misses-init', '-Wlogical-not-parentheses', '-Wlogical-op', '-Wmain', @@ -293,6 +321,7 @@ cc_flags +=3D [ '-Wnested-externs', '-Wnonnull', '-Wnonnull-compare', + '-Wnormalized=3Dnfc', '-Wnull-dereference', '-Wodr', '-Wold-style-declaration', @@ -318,32 +347,41 @@ cc_flags +=3D [ '-Wshift-count-negative', '-Wshift-count-overflow', '-Wshift-negative-value', + '-Wshift-overflow=3D2', + # So we have -W enabled, and then have to explicitly turn off... + '-Wno-sign-compare', '-Wsizeof-array-argument', '-Wsizeof-pointer-div', '-Wsizeof-pointer-memaccess', '-Wstrict-aliasing', '-Wstrict-prototypes', + '-Wstringop-overflow=3D2', '-Wstringop-truncation', '-Wsuggest-attribute=3Dcold', - '-Wsuggest-attribute=3Dconst', + '-Wno-suggest-attribute=3Dconst', '-Wsuggest-attribute=3Dformat', '-Wsuggest-attribute=3Dnoreturn', - '-Wsuggest-attribute=3Dpure', + '-Wno-suggest-attribute=3Dpure', '-Wsuggest-final-methods', '-Wsuggest-final-types', '-Wswitch', '-Wswitch-bool', + '-Wswitch-enum', '-Wswitch-unreachable', '-Wsync-nand', '-Wtautological-compare', '-Wtrampolines', '-Wtrigraphs', '-Wtype-limits', + # Clang incorrectly complains about dup typedefs win gnu99 mode + # so use this Clang-specific arg to keep it quiet + '-Wno-typedef-redefinition', '-Wuninitialized', '-Wunknown-pragmas', '-Wunused', '-Wunused-but-set-parameter', '-Wunused-but-set-variable', + '-Wunused-const-variable=3D2', '-Wunused-function', '-Wunused-label', '-Wunused-local-typedefs', @@ -355,79 +393,11 @@ cc_flags +=3D [ '-Wvariadic-macros', '-Wvector-operation-performance', '-Wvla', + '-Wvla-larger-then=3D4031', '-Wvolatile-register-var', '-Wwrite-strings', ] =20 -# gcc --help=3Dwarnings outputs -ptrdiff_max =3D cc.sizeof('ptrdiff_t', prefix: '#include ') -size_max =3D cc.sizeof('size_t', prefix: '#include ') -# Compute max safe object size by checking ptrdiff_t and size_t sizes. -# Ideally we would get PTRDIFF_MAX and SIZE_MAX values but it would -# give us (2147483647L) and we would have to remove the () and the suffix -# in order to convert it to numbers to be able to pick the smaller one. -alloc_max =3D run_command( - 'python3', '-c', - 'print(min(2**(@0@ * 8 - 1) - 1, 2**(@1@ * 8) - 1))'.format(ptrdiff_max,= size_max), -) -cc_flags +=3D [ - '-Walloc-size-larger-than=3D@0@'.format(alloc_max.stdout().strip()), - '-Warray-bounds=3D2', - '-Wattribute-alias=3D2', - '-Wformat-overflow=3D2', - '-Wformat-truncation=3D2', - '-Wimplicit-fallthrough=3D5', - '-Wnormalized=3Dnfc', - '-Wshift-overflow=3D2', - '-Wstringop-overflow=3D2', - '-Wunused-const-variable=3D2', - '-Wvla-larger-then=3D4031', -] - -cc_flags +=3D [ - # So we have -W enabled, and then have to explicitly turn off... - '-Wno-sign-compare', - - # We do "bad" function casts all the time for event callbacks - '-Wno-cast-function-type', - - # Clang incorrectly complains about dup typedefs win gnu99 mode - # so use this Clang-specific arg to keep it quiet - '-Wno-typedef-redefinition', - - # We don't use -Wc++-compat so we have to enable it explicitly - '-Wjump-misses-init', - - # -Wswitch is enabled but that doesn't report missing enums if a default: - # is present - '-Wswitch-enum', - - # -Wformat=3D2 implies -Wformat-nonliteral so we need to manually exclud= e it - '-Wno-format-nonliteral', - - # -Wformat enables this by default, and we should keep it, - # but need to rewrite various areas of code first - '-Wno-format-truncation', - - # This should be < 256 really. Currently we're down to 4096, - # but using 1024 bytes sized buffers (mostly for virStrerror) - # stops us from going down further - '-Wframe-larger-than=3D4096', - - # extra special flags - '-fexceptions', - '-fasynchronous-unwind-tables', - - # Need -fipa-pure-const in order to make -Wsuggest-attribute=3Dpure - # fire even without -O. - '-fipa-pure-const', - - # We should eventually enable this, but right now there are at - # least 75 functions triggering warnings. - '-Wno-suggest-attribute=3Dpure', - '-Wno-suggest-attribute=3Dconst', -] - # on aarch64 error: -fstack-protector not supported for this target if host_machine.cpu_family() !=3D 'aarch64' if host_machine.system() in [ 'linux', 'freebsd', 'windows' ] --=20 2.30.2 From nobody Fri Apr 26 08:42:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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=1617879529; cv=none; d=zohomail.com; s=zohoarc; b=U4cvYGTPTKewgmB/fwSl0yxGCZ5whidqFObyx6yRVjmxtDj+BAOYgmWa0FO9eZxzkVLgLws80Bn6HkQ8SfnVKtOayom3NU6ufoPXRjXQvrUahF6/LcvH/psCxEcl6gfxDoZOMUfVO5PeLnex3N8jNCsPVISuuHN83j1uYLip93E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617879529; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=E/vWOhn7AP7EH1R1UsvCMeC10stj6j5smDJ7M+gRhck=; b=AX6pv9poxOVQHsSi5F/GAfu2JEjKCOQrZ9bT7s24EoDYQkW4Qn5TuZSqUNMxhUmD1aL0Eo9iwtbgaSxIMRHtVBSHxRKhYiTlKSOFWYdZydTImSjOW3xCeZ6hesAMmJLY3b17qCXLbTu/Wps7D1Llp88c2lKGkI1ieYvoHxsCZq8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1617879529117963.3294306703089; Thu, 8 Apr 2021 03:58:49 -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-498-0yAplSHxMBuFM0eRNJ4hIw-1; Thu, 08 Apr 2021 06:58:45 -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 D70C018BA28E; Thu, 8 Apr 2021 10:58:37 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B311351C96; Thu, 8 Apr 2021 10:58:37 +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 7589C1806D11; Thu, 8 Apr 2021 10:58:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 138AwXbH006244 for ; Thu, 8 Apr 2021 06:58:33 -0400 Received: by smtp.corp.redhat.com (Postfix) id 922F710016FD; Thu, 8 Apr 2021 10:58:33 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-81.ams2.redhat.com [10.36.115.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB8CE10013D7; Thu, 8 Apr 2021 10:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617879527; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=E/vWOhn7AP7EH1R1UsvCMeC10stj6j5smDJ7M+gRhck=; b=BawvOJO1S0KuuL/Cnk+UjxIIl34ON+SKhPpxnFoPNUytXNCzd4oPGMWd0+DGEyJ/CbmaWU z7FbE/5v8QXvMEsD7c29y9w1fvQ34jXSPMYj7LSZt4IeRn8Fj0hjVj8JZHQH9xv1DjE/II 8MTvdw8dsNL/E89T8SsfzY7nhc/DMGU= X-MC-Unique: 0yAplSHxMBuFM0eRNJ4hIw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/6] meson: avoid checking compiler flags twice Date: Thu, 8 Apr 2021 11:58:21 +0100 Message-Id: <20210408105823.462584-5-berrange@redhat.com> In-Reply-To: <20210408105823.462584-1-berrange@redhat.com> References: <20210408105823.462584-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) In several cases we check if a compiler flag is supported, and then add it to the 'cc_flags' array. The entire 'cc_flags' array is then later tested to see if each flag is supported, which duplicates the check in some cases. Move the check of cc_flags earlier, and for the extra flags append directly to supported_cc_flags to avoid the duplicate check Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index 55dde6d963..cf0e4f5715 100644 --- a/meson.build +++ b/meson.build @@ -398,6 +398,8 @@ cc_flags +=3D [ '-Wwrite-strings', ] =20 +supported_cc_flags =3D cc.get_supported_arguments(cc_flags) + # on aarch64 error: -fstack-protector not supported for this target if host_machine.cpu_family() !=3D 'aarch64' if host_machine.system() in [ 'linux', 'freebsd', 'windows' ] @@ -406,7 +408,7 @@ if host_machine.cpu_family() !=3D 'aarch64' '-fstack-protector-strong', '-fstack-protector-all', ]) - cc_flags +=3D fstack_cflags + supported_cc_flags +=3D fstack_cflags =20 # When building with mingw using -fstack-protector requires libssp lib= rary # which is included by using -fstack-protector with linker. @@ -416,7 +418,7 @@ if host_machine.cpu_family() !=3D 'aarch64' endif endif =20 -if cc.has_argument('-Wlogical-op') +if supported_cc_flags.contains('-Wlogical-op') # Broken in 6.0 and later # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69602 w_logical_op_args =3D ['-O2', '-Wlogical-op', '-Werror'] @@ -445,7 +447,7 @@ w_double_promotion_code =3D ''' } ''' if cc.compiles(w_double_promotion_code, args: w_double_promotion_args, nam= e: '-Wdouble-promotion') - cc_flags +=3D ['-Wdouble-promotion'] + supported_cc_flags +=3D ['-Wdouble-promotion'] endif =20 # Clang complains about unused static inline functions which are common @@ -458,10 +460,9 @@ w_unused_function_code =3D ''' ''' # -Wunused-function is implied by -Wall, we must turn it off explicitly. if not cc.compiles(w_unused_function_code, args: w_unused_function_args) - cc_flags +=3D ['-Wno-unused-function'] + supported_cc_flags +=3D ['-Wno-unused-function'] endif =20 -supported_cc_flags =3D cc.get_supported_arguments(cc_flags) add_project_arguments(supported_cc_flags, language: 'c') =20 if cc.has_argument('-Wsuggest-attribute=3Dformat') --=20 2.30.2 From nobody Fri Apr 26 08:42:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1617879549; cv=none; d=zohomail.com; s=zohoarc; b=bTccfmpz+WIAip1y1Vbrw4cayNDvpMEuTq+B3U4AUOV624kl8USWnWxiFCU9qsSMqTZohRD1YqHxx1/IdeyMyy2hE3wzdivrek0FgnYv1twPL9ennLvZFuFxh8qejPP6FhAEsWqxqvWrOKu0/eGkHiOClFHyWUMNsxxKZ9fKLD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617879549; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=I4433Q0fE/4SfjXpxfBryezP7ooaxHSIvl7lf0sJPwQ=; b=cMVPaA9EF2EK77TK6OuT3d3gXZa3woPaPtTC/yNK3cOLJSpr9zvK1/rFIegtB5+92Z2e05IcXCnwSm8BnzAdvbTcggLhekcCwt63LsDJTk68RbnWHQVVVohk/X7RzoWJAj32DLKwpeok+PA71SEKTQom0ypzQYbfMiY8Romuii4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1617879549584651.1690919132396; Thu, 8 Apr 2021 03:59:09 -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-589-EEtj6KCZMamXd9NuJowLPA-1; Thu, 08 Apr 2021 06:58:45 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3275B18BA287; Thu, 8 Apr 2021 10:58:39 +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 026A810013D7; Thu, 8 Apr 2021 10:58:39 +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 B79735534D; Thu, 8 Apr 2021 10:58:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 138AwYZZ006251 for ; Thu, 8 Apr 2021 06:58:34 -0400 Received: by smtp.corp.redhat.com (Postfix) id B2530104254C; Thu, 8 Apr 2021 10:58:34 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-81.ams2.redhat.com [10.36.115.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3E1510013D7; Thu, 8 Apr 2021 10:58:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617879548; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=I4433Q0fE/4SfjXpxfBryezP7ooaxHSIvl7lf0sJPwQ=; b=d4UVMDKFnrqalui1CvNMI7thGNziHvERdiSiEAeD1kKKuR83DrV1RqC1c2yU9NTnFENEWi se8j6tyY7YCb9WnC/BeDq75syOLHXUyNFQbdECTazZMGTn5ulpOCyojW5CBTu0kRa/BIrM aGflimkvOyO9NCgyGcoMhQTkMfMUmFs= X-MC-Unique: EEtj6KCZMamXd9NuJowLPA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 5/6] meson: honour meson warning_level option Date: Thu, 8 Apr 2021 11:58:22 +0100 Message-Id: <20210408105823.462584-6-berrange@redhat.com> In-Reply-To: <20210408105823.462584-1-berrange@redhat.com> References: <20210408105823.462584-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Meson defines a warning_level option which has the following behaviour with C code 0: no warning flags 1: -Wall 2: -Wall -Wextra 3: -Wall -Wextra -Wpedantic Currently we add our extra warning flags unconditionally if the compiler supports them, regardless of the meson warning_level setting. This has effectively nullified the warning_level setting in meson, and also results in meson printing these messages: meson.build:498: WARNING: Consider using the built-in warning_level optio= n instead of using "-Wall". meson.build:498: WARNING: Consider using the built-in warning_level optio= n instead of using "-Wextra". Semantically we can think of our huge list of flags as being an "extra" set of warnings, and thus we ought to only add them when meson would itself use -Wextra. aka warning_level =3D=3D 2 or 3. In practice libvirt code can't be built with -Wpedantic so we can ignore meson warning_level 3, and only add our flags when warning_level=3D=3D2. In doing this change, we no longer have to check -Wall/-Wextra ourselves as we can assume meson already set them. -W is an alias of -Wextra so it is removed too. Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 112 ++++++++++++++++++++++++++-------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/meson.build b/meson.build index cf0e4f5715..9fda0c7948 100644 --- a/meson.build +++ b/meson.build @@ -229,12 +229,10 @@ cc_flags +=3D [ '-fexceptions', '-fipa-pure-const', '-fno-common', - '-W', '-Wabsolute-value', '-Waddress', '-Waddress-of-packed-member', '-Waggressive-loop-optimizations', - '-Wall', '-Walloc-size-larger-than=3D@0@'.format(alloc_max.stdout().strip()), '-Warray-bounds=3D2', '-Wattribute-alias=3D2', @@ -268,7 +266,6 @@ cc_flags +=3D [ '-Wempty-body', '-Wendif-labels', '-Wexpansion-to-defined', - '-Wextra', '-Wformat-contains-nul', '-Wformat-extra-args', # -Wformat=3D2 implies -Wformat-nonliteral so we need to manually exclud= e it @@ -398,71 +395,74 @@ cc_flags +=3D [ '-Wwrite-strings', ] =20 -supported_cc_flags =3D cc.get_supported_arguments(cc_flags) - -# on aarch64 error: -fstack-protector not supported for this target -if host_machine.cpu_family() !=3D 'aarch64' - if host_machine.system() in [ 'linux', 'freebsd', 'windows' ] - # we prefer -fstack-protector-strong but fallback to -fstack-protector= -all - fstack_cflags =3D cc.first_supported_argument([ - '-fstack-protector-strong', - '-fstack-protector-all', - ]) - supported_cc_flags +=3D fstack_cflags - - # When building with mingw using -fstack-protector requires libssp lib= rary - # which is included by using -fstack-protector with linker. - if fstack_cflags.length() =3D=3D 1 and host_machine.system() =3D=3D 'w= indows' - add_project_link_arguments(fstack_cflags, language: 'c') +supported_cc_flags =3D [] +if get_option('warning_level') =3D=3D '2' + supported_cc_flags =3D cc.get_supported_arguments(cc_flags) + + # on aarch64 error: -fstack-protector not supported for this target + if host_machine.cpu_family() !=3D 'aarch64' + if host_machine.system() in [ 'linux', 'freebsd', 'windows' ] + # we prefer -fstack-protector-strong but fallback to -fstack-protect= or-all + fstack_cflags =3D cc.first_supported_argument([ + '-fstack-protector-strong', + '-fstack-protector-all', + ]) + supported_cc_flags +=3D fstack_cflags + + # When building with mingw using -fstack-protector requires libssp l= ibrary + # which is included by using -fstack-protector with linker. + if fstack_cflags.length() =3D=3D 1 and host_machine.system() =3D=3D = 'windows' + add_project_link_arguments(fstack_cflags, language: 'c') + endif + endif + endif + + if supported_cc_flags.contains('-Wlogical-op') + # Broken in 6.0 and later + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69602 + w_logical_op_args =3D ['-O2', '-Wlogical-op', '-Werror'] + w_logical_op_code =3D ''' + #define TEST1 1 + #define TEST2 TEST1 + + int main(void) { + int test =3D 0; + return test =3D=3D TEST1 || test =3D=3D TEST2; + } + ''' + if not cc.compiles(w_logical_op_code, args: w_logical_op_args) + conf.set('BROKEN_GCC_WLOGICALOP_EQUAL_EXPR', 1) endif endif -endif =20 -if supported_cc_flags.contains('-Wlogical-op') - # Broken in 6.0 and later - # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D69602 - w_logical_op_args =3D ['-O2', '-Wlogical-op', '-Werror'] - w_logical_op_code =3D ''' - #define TEST1 1 - #define TEST2 TEST1 + # Check whether clang gives bogus warning for -Wdouble-promotion. + w_double_promotion_args =3D ['-O2', '-Wdouble-promotion', '-Werror'] + w_double_promotion_code =3D ''' + #include =20 int main(void) { - int test =3D 0; - return test =3D=3D TEST1 || test =3D=3D TEST2; + float f =3D 0.0; + return isnan(f); } ''' - if not cc.compiles(w_logical_op_code, args: w_logical_op_args) - conf.set('BROKEN_GCC_WLOGICALOP_EQUAL_EXPR', 1) + if cc.compiles(w_double_promotion_code, args: w_double_promotion_args, n= ame: '-Wdouble-promotion') + supported_cc_flags +=3D ['-Wdouble-promotion'] endif -endif =20 -# Check whether clang gives bogus warning for -Wdouble-promotion. -w_double_promotion_args =3D ['-O2', '-Wdouble-promotion', '-Werror'] -w_double_promotion_code =3D ''' - #include + # Clang complains about unused static inline functions which are common + # with G_DEFINE_AUTOPTR_CLEANUP_FUNC. + w_unused_function_args =3D ['-Wunused-function', '-Werror'] + w_unused_function_code =3D ''' + static inline void foo(void) {} =20 - int main(void) { - float f =3D 0.0; - return isnan(f); - } -''' -if cc.compiles(w_double_promotion_code, args: w_double_promotion_args, nam= e: '-Wdouble-promotion') - supported_cc_flags +=3D ['-Wdouble-promotion'] -endif - -# Clang complains about unused static inline functions which are common -# with G_DEFINE_AUTOPTR_CLEANUP_FUNC. -w_unused_function_args =3D ['-Wunused-function', '-Werror'] -w_unused_function_code =3D ''' - static inline void foo(void) {} + int main(void) { return 0; } + ''' + # -Wunused-function is implied by -Wall, we must turn it off explicitly. + if not cc.compiles(w_unused_function_code, args: w_unused_function_args) + supported_cc_flags +=3D ['-Wno-unused-function'] + endif =20 - int main(void) { return 0; } -''' -# -Wunused-function is implied by -Wall, we must turn it off explicitly. -if not cc.compiles(w_unused_function_code, args: w_unused_function_args) - supported_cc_flags +=3D ['-Wno-unused-function'] endif - add_project_arguments(supported_cc_flags, language: 'c') =20 if cc.has_argument('-Wsuggest-attribute=3Dformat') --=20 2.30.2 From nobody Fri Apr 26 08:42:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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=1617879532; cv=none; d=zohomail.com; s=zohoarc; b=bpLkbRvY57Hezrl/E4D0/X9aQcTExZJiIy8/aBXWvivo/FBc5dtj1r1dS+nsRmagVpaTkD7MU7N1OSprmCqWCe+/aEkzdxddwR9G5HdKSzNjLoQDQt+SeZPTyon7WkB1Akcz7YYYOKw2l2TU/yOXFOIUKlTVl22OO7j6adg72rI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617879532; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=o2M9O8Cbo11UMaN8HyBxhQnlf7hHvU+3Kn0cTMjSl6I=; b=NNCejm/SiVK1F7C48LhjxMasZldyHv8jot94g5Fu2Z52OkyPKTxcwQHLwwVnqUuxyowDBjU6N20JAJW37rKhC+txwarD5l/3oiQI5F9h3v58J3hI7+BLdvKiId+6LtwIK/OCm+mYos7/gS+pPih0tHk15dwiBIzbpjUcyd4hxHQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1617879532560658.3878434267655; Thu, 8 Apr 2021 03:58:52 -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-105-sK6OTZSfO9aLpoPNbjSDjw-1; Thu, 08 Apr 2021 06:58:48 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31908107ACCA; Thu, 8 Apr 2021 10:58:42 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 05F2210013D7; Thu, 8 Apr 2021 10:58:42 +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 BE5321806D13; Thu, 8 Apr 2021 10:58:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 138AwZH6006266 for ; Thu, 8 Apr 2021 06:58:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id EC02C10016FD; Thu, 8 Apr 2021 10:58:35 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-81.ams2.redhat.com [10.36.115.81]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1FDA110013D7; Thu, 8 Apr 2021 10:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617879531; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=o2M9O8Cbo11UMaN8HyBxhQnlf7hHvU+3Kn0cTMjSl6I=; b=UfUkV/2Z4ys6DoaacB+pF/xbcT45IDK2lfFz0G8K9ME3fYw+rSdA996anhfaeHfBBd7T/3 cf5iLzhTWqDb5TOBGGSwqUuSWYKyAfFoC3MVywYhsMUT9vCSDdQqNOUNbmvrQ1aJKsdF88 NCAoTMGEVO/ZC4QhQ1k+tNzOE4wdxdQ= X-MC-Unique: sK6OTZSfO9aLpoPNbjSDjw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 6/6] meson: don't probe for -Werror if -Dwerror is enabled Date: Thu, 8 Apr 2021 11:58:23 +0100 Message-Id: <20210408105823.462584-7-berrange@redhat.com> In-Reply-To: <20210408105823.462584-1-berrange@redhat.com> References: <20210408105823.462584-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Meson has its own mechanism to turn on -Werror with the -Dwerror option. If this is set, then there is no reason for libvirt to check for -Werror itself. We remove the summary line output because it is potentially misleading when libvirt hasn't enabled -Werror, but meson has. Signed-off-by: Daniel P. Berrang=C3=A9 --- meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 9fda0c7948..725d0e1cf0 100644 --- a/meson.build +++ b/meson.build @@ -207,7 +207,7 @@ cc =3D meson.get_compiler('c') cc_flags =3D [] =20 git_werror =3D get_option('git_werror') -if git_werror.enabled() or git_werror.auto() and git +if (git_werror.enabled() or git_werror.auto()) and git and not get_option(= 'werror') cc_flags +=3D [ '-Werror' ] endif =20 @@ -2300,7 +2300,6 @@ else loader_res =3D '' endif misc_summary =3D { - 'Use -Werror': cc_flags.contains('-Werror'), 'Warning Flags': supported_cc_flags, 'docs': gen_docs, 'tests': build_tests, --=20 2.30.2