From nobody Sat Apr 27 15:32:38 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1502468747523245.11907931454073; Fri, 11 Aug 2017 09:25:47 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 51CFD2D26B6; Fri, 11 Aug 2017 16:25:45 +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 2959FA21AB; Fri, 11 Aug 2017 16:25:44 +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 A0F7A1805974; Fri, 11 Aug 2017 16:25:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v7BGPeUF013286 for ; Fri, 11 Aug 2017 12:25:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 202E4D7665; Fri, 11 Aug 2017 16:25:40 +0000 (UTC) Received: from t460.redhat.com (ovpn-117-69.ams2.redhat.com [10.36.117.69]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9FEAAD7673; Fri, 11 Aug 2017 16:25:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 51CFD2D26B6 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=libvir-list-bounces@redhat.com From: "Daniel P. Berrange" To: libvir-list@redhat.com Date: Fri, 11 Aug 2017 17:25:32 +0100 Message-Id: <20170811162532.8679-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] m4: workaround clang/glibc problem with isnan() 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 11 Aug 2017 16:25:46 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" When building libvirt with clang we get bogus warnings about 'double' being promoted to 'long double' when calling isnan(). https://bugzilla.redhat.com/show_bug.cgi?id=3D1472437 Detect this broken isnan() / compiler combination and disable the -Wdouble-promotion flag. Signed-off-by: Daniel P. Berrange --- m4/virt-compile-warnings.m4 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index fa0940fc6..7b56115ce 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -134,6 +134,24 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ [lv_cv_gcc_wlogical_op_equal_expr_broken=3Dyes]) CFLAGS=3D"$save_CFLAGS"]) =20 + AC_CACHE_CHECK([whether clang gives bogus warnings for -Wdouble-promot= ion], + [lv_cv_clang_double_promotion_broken], [ + save_CFLAGS=3D"$CFLAGS" + CFLAGS=3D"-O2 -Wdouble-promotion -Werror" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + #include + ]], [[ + float f =3D 0.0; + return isnan(f);]])], + [lv_cv_clang_double_promotion_broken=3Dno], + [lv_cv_clang_double_promotion_broken=3Dyes]) + CFLAGS=3D"$save_CFLAGS"]) + + if test "$lv_cv_clang_double_promotion_broken" =3D "yes"; + then + dontwarn=3D"$dontwarn -Wdouble-promotion" + fi + # We might fundamentally need some of these disabled forever, but # ideally we'd turn many of them on dontwarn=3D"$dontwarn -Wfloat-equal" --=20 2.13.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list