From nobody Fri Apr 19 01:22:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1595438994; cv=none; d=zohomail.com; s=zohoarc; b=PvpjCWvMDdxTe2nketzBmiZ0h/1+dE5itcyJn9c0FsqOShe1WG3YD34hHhhdCniKeJGqCdag23ED9XmxjVEM6ZGBlatKvfRwFJhMV6uUUVjqOUyWI/D6GIHmbPVRGpG4xJfr1UnnAYYp278rkP+CXOPXrG1JSl+XAFj7KRvYITQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595438994; 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=t7GQJDKspVngX2yWVvTC0Yni11zxTnIqN0y7y/4YG8k=; b=Q7jpm2MDSz98taj2WOpEXh4YBQme0TJTeZdpajuBOoflXgpRD4Vw5TEYu3yypLIQK3KQqXBAlyRRkkmvayyzbYmffG+VyRXW+Q1adUf+cjpERuXA5vPpWpSyt88hFPDBFcX9UE1MLtD/chnn19W4ZHrGXt4Xn2b8cI0RLVs5gLg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1595438994873956.5002108736295; Wed, 22 Jul 2020 10:29:54 -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-227-I2vlS4Y0MbqNGT9FODMwqg-1; Wed, 22 Jul 2020 13:29:51 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 33B96800460; Wed, 22 Jul 2020 17:29:45 +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 014EE2B4DD; Wed, 22 Jul 2020 17:29: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 BB759730ED; Wed, 22 Jul 2020 17:29:44 +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 06MHLlSl028392 for ; Wed, 22 Jul 2020 13:21:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id CA76C1010405; Wed, 22 Jul 2020 17:21:47 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37683100EBB3; Wed, 22 Jul 2020 17:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595438993; 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=t7GQJDKspVngX2yWVvTC0Yni11zxTnIqN0y7y/4YG8k=; b=Qmt/m9EgoyZs50FX9a9jZ5MC4hp2njjqcqQauFsr6vknRrokzrPsR55ObENB06KD9TxDzE 5f1BP1f73sIMjAVScMDteXjn0G2nTtuiXSSZ6/uGXmFfYo1rQtJvcmwc9fihKDBwK0wy3U K1kNQmGtAaUiPJxe9dGTANPCPWVk8PY= X-MC-Unique: I2vlS4Y0MbqNGT9FODMwqg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/4] util: refactor code to workaround gcc 10.1.0 bug Date: Wed, 22 Jul 2020 18:21:39 +0100 Message-Id: <20200722172142.1847640-2-berrange@redhat.com> In-Reply-To: <20200722172142.1847640-1-berrange@redhat.com> References: <20200722172142.1847640-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.23 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) gcc 10.1.0 on Debian sid has a bug where the bounds checking gets confused beteen two branches: In file included from /usr/include/string.h:495, from ../../src/internal.h:28, from ../../src/util/virsocket.h:21, from ../../src/util/virsocketaddr.h:21, from ../../src/util/virnetdevip.h:21, from ../../src/util/virnetdevip.c:21: In function 'memcpy', inlined from 'virNetDevGetifaddrsAddress' at ../../src/util/virnetdevip= .c:914:13, inlined from 'virNetDevIPAddrGet' at ../../src/util/virnetdevip.c:962:1= 6: /usr/include/arm-linux-gnueabihf/bits/string_fortified.h:34:10: error: '__b= uiltin_memcpy' offset [16, 27] from the object at 'addr' is out of the boun= ds of referenced subobject 'inet4' with type 'struct sockaddr_in' at offset= 0 [-Werror=3Darray-bounds] 34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__de= st)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~= ~~~~ In file included from ../../src/util/virnetdevip.h:21, from ../../src/util/virnetdevip.c:21: ../../src/util/virnetdevip.c: In function 'virNetDevIPAddrGet': ../../src/util/virsocketaddr.h:29:28: note: subobject 'inet4' declared here 29 | struct sockaddr_in inet4; | ^~~~~ cc1: all warnings being treated as errors Note the source location is pointing to the "inet6" / AF_INET6 branch of the "if", but is complaining about bounds of the "inet4" field. Changing the code into a switch() is sufficient to avoid triggering the bug and is arguably better code too. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laine Stump --- src/util/virnetdevip.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index ba9e567e5a..8b85c7beca 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -897,26 +897,25 @@ virNetDevGetifaddrsAddress(const char *ifname, } =20 for (ifa =3D ifap; ifa; ifa =3D ifa->ifa_next) { - int family; - if (STRNEQ_NULLABLE(ifa->ifa_name, ifname)) continue; =20 if (!ifa->ifa_addr) continue; - family =3D ifa->ifa_addr->sa_family; - - if (family !=3D AF_INET6 && family !=3D AF_INET) - continue; =20 - if (family =3D=3D AF_INET6) { + switch (ifa->ifa_addr->sa_family) { + case AF_INET6: addr->len =3D sizeof(addr->data.inet6); memcpy(&addr->data.inet6, ifa->ifa_addr, addr->len); - } else { + break; + case AF_INET: addr->len =3D sizeof(addr->data.inet4); memcpy(&addr->data.inet4, ifa->ifa_addr, addr->len); + break; + default: + continue; } - addr->data.stor.ss_family =3D family; + addr->data.stor.ss_family =3D ifa->ifa_addr->sa_family; ret =3D 0; goto cleanup; } --=20 2.24.1 From nobody Fri Apr 19 01:22:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1595438998; cv=none; d=zohomail.com; s=zohoarc; b=FqH0uu/nzvWPZlIDrwF7u/DiM7rG/HvE7yaAaZ5ofmGBSnG+tUhFwM+kekQZYeeyQv2dXdNMKlW/Be8ceWdQH+WI2F/KuKrmRQbMI8c5SdkL5x9qxpkZlYLLlaCQE+STuYC2ErHK+7zFet6ZkZfeNy/NJQSkfGfCGj7LtHG+ptE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595438998; 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=jN1kg0fxmbvBWpJ9XhBscU+YC1FTa67TxBFzHCelDH8=; b=l/ynfZM12EaOWDTTfWDQ5tpnM4Bqm+lCvQNmkxXJ+NEaR31sU0fQAR1gaUsaEfB9apq55la0dCAzPlOKGcdBwldZ0jGuaCoYT2AW/sJ1bObcnMpeEi02vjC5fc3pgUWzLaqEF4OcVSlRbY6DVWOOGPAAqIonb5FLKX9VYEzvyHs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1595438998088674.8351192537109; Wed, 22 Jul 2020 10:29:58 -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-334-S7XGUHjpNtCUWcNvlzV7lw-1; Wed, 22 Jul 2020 13:29:54 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9D7CB800469; Wed, 22 Jul 2020 17:29:47 +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 7CB6488D40; Wed, 22 Jul 2020 17:29:47 +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 31AAF730F5; Wed, 22 Jul 2020 17:29:47 +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 06MHLoBU028409 for ; Wed, 22 Jul 2020 13:21:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id E0A321010405; Wed, 22 Jul 2020 17:21:50 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DB851010404; Wed, 22 Jul 2020 17:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595438996; 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=jN1kg0fxmbvBWpJ9XhBscU+YC1FTa67TxBFzHCelDH8=; b=V/VUjUXtR27ZTP0nekibFsKYPeL/4RK/ts6Qrykb3ZaQmm7eIFOWhzk1rWjGN+uy6MoJOf j/O7JbX/aaViHMKTONXjZmCpRDvBByoNoP2P3zGPasA9Fi+9ueS3NmjhfYDErUBTsE5Rpt of6dOVi5nI/0a/OEj6QCgld6ZiAMiF4= X-MC-Unique: S7XGUHjpNtCUWcNvlzV7lw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/4] m4: enable -fstack-protector-strong on mingw Date: Wed, 22 Jul 2020 18:21:40 +0100 Message-Id: <20200722172142.1847640-3-berrange@redhat.com> In-Reply-To: <20200722172142.1847640-1-berrange@redhat.com> References: <20200722172142.1847640-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.11 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) Historically we avoided -fstack-protector* since it resulted in a broken build on Mingw. In GCC 10 in Fedora though, we have the opposite problem, getting a broken build if we don't enable one of the -fstack-protector* options. This also works in GCC 9, so we don't need to worry about the old brokeness which evidentally got fixed at some time without noticing. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laine Stump --- m4/virt-compile-warnings.m4 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4 index d3538d59f8..d171d09991 100644 --- a/m4/virt-compile-warnings.m4 +++ b/m4/virt-compile-warnings.m4 @@ -169,13 +169,11 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[ gl_WARN_ADD([-Wframe-larger-than=3D262144], [RELAXED_FRAME_LIMIT_CFLAG= S]) =20 # Extra special flags - dnl -fstack-protector stuff passes gl_WARN_ADD with gcc - dnl on Mingw32, but fails when actually used case $host in aarch64-*-*) dnl "error: -fstack-protector not supported for this target [-Werro= r]" ;; - *-*-linux*) + *-*-linux* | *-*-mingw*) dnl Prefer -fstack-protector-strong if it's available. dnl There doesn't seem to be great overhead in adding dnl -fstack-protector-all instead of -fstack-protector. --=20 2.24.1 From nobody Fri Apr 19 01:22:46 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=1595439003; cv=none; d=zohomail.com; s=zohoarc; b=XvVGTBwaTQEaCRWu1nBqYkIY/1kjEA2UuBWC2S4lQBtRF1u4tuiPqbs4Qd3hHtTjmXhXIsmRAv6VVvtpDKXMBqo3aeDllCwNZeDMqRMzw5acQUjzfyPMRLyLqz45EzGp5w8F9H3F/IPl1wHANf4nRj0qpJ/4fKH80gqjQQnGDbU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595439003; 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=VCLqblO1THJ4yK3lzwpun2/oOZ3SCiFqQgQn1bZhhaE=; b=EVqhQVcpEQd1NE9Xa2zwo/WEr/EynMuP/Ja7fPmD4DcSppswnbQ7aYEN8y9JcF2xXucVr1rKryjdyL46xmJeKFLokEqCB2mTBRhn96T5iQhk5UJl34swZrRivR/75zwEDNTguev7LYY+ljBT38ov0i/WSjaZ1W+LgkZ/naHdLlg= 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 1595439003423444.6159424571399; Wed, 22 Jul 2020 10:30:03 -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-266-dM6VZi2MP4ybxO_rvuWYmw-1; Wed, 22 Jul 2020 13:29:59 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E3A91185BDEE; Wed, 22 Jul 2020 17:29:49 +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 C599388D44; Wed, 22 Jul 2020 17:29:49 +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 90DA3730F7; Wed, 22 Jul 2020 17:29:49 +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 06MHLpOq028415 for ; Wed, 22 Jul 2020 13:21:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id C69391010404; Wed, 22 Jul 2020 17:21:51 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 341781010403; Wed, 22 Jul 2020 17:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595439002; 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=VCLqblO1THJ4yK3lzwpun2/oOZ3SCiFqQgQn1bZhhaE=; b=NN9HgyVMoAR0XuU2qyc/gWXvlFWJa3ttpwkHRNadAJd3jw79uYX6GiViWVbz4vBOGv25ag Do94g9nQl4hk5qEFRGAChMl++X3OhOzN45r2ObUYD6ixLDkQc0CcHMvj3MqCXGqujXZNVx pahBNdX6RGtRl2FMtl6drFImD022rKA= X-MC-Unique: dM6VZi2MP4ybxO_rvuWYmw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 3/4] tests: don't mock the time() function on mingw Date: Wed, 22 Jul 2020 18:21:41 +0100 Message-Id: <20200722172142.1847640-4-berrange@redhat.com> In-Reply-To: <20200722172142.1847640-1-berrange@redhat.com> References: <20200722172142.1847640-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.11 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 mingw header define time() as a static inline function and this causes a duplicate definition build failure. Since we're not using the LD_PRELOAD at all on Mingw, we ideally wouldn't compile any of the mock libraries. Rather than change the build system now though, this just stubs out the offending function. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laine Stump Reviewed-by: Michal Privoznik --- tests/virnetdaemonmock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/virnetdaemonmock.c b/tests/virnetdaemonmock.c index 3b92fff8c9..c523da0791 100644 --- a/tests/virnetdaemonmock.c +++ b/tests/virnetdaemonmock.c @@ -23,6 +23,7 @@ =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 +#ifndef WIN32 time_t time(time_t *t) { const time_t ret =3D 1234567890; @@ -30,3 +31,4 @@ time_t time(time_t *t) *t =3D ret; return ret; } +#endif --=20 2.24.1 From nobody Fri Apr 19 01:22:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1595439022; cv=none; d=zohomail.com; s=zohoarc; b=inPLlZTrh7QYHy+HNtWQft0a2pHPC9mQRdEWUbbd7P4V5BV0lRE9E8aHObKSt3+nEou/RbFEV6+Nxn8mLwjonW/9uGEyONLUURmyWQOyfc3iDpnb34WuREBnYN2nJJIzNemy7V1z2pPU947JK5QcxD3aOtmrU+KHPrKskRNbgyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595439022; 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=ivcM8f9pN0SkhbvUUyl0YEA3uL3N8mKrfFFMSmecblk=; b=GjrkoId0fD1YMqtEGh01Q8GYcahqAOeGbN0s61xmCb3DnCCYSB0arQMFWEgD+BN62QRr0YD4X4H1x9EkGsy0pbUkuqFQlLctq+F5sN3jCbd6oUQRPOo7BIY2/IoXueeysQ8NIb2122mei9ppBmxD0lt5rjMGaSUQlLdD9h3wH3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1595439022309856.7745073819955; Wed, 22 Jul 2020 10:30:22 -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-514-lxxAJMGFMoe-t9xOPtJuNQ-1; Wed, 22 Jul 2020 13:30:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 93686185BDEA; Wed, 22 Jul 2020 17:30:12 +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 732C188D41; Wed, 22 Jul 2020 17:30:12 +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 3D73D730FF; Wed, 22 Jul 2020 17:30:12 +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 06MHLqKX028423 for ; Wed, 22 Jul 2020 13:21:52 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC58C1017CD3; Wed, 22 Jul 2020 17:21:52 +0000 (UTC) Received: from domokun.gsslab.fab.redhat.com (unknown [10.33.8.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19E4A1010403; Wed, 22 Jul 2020 17:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595439021; 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=ivcM8f9pN0SkhbvUUyl0YEA3uL3N8mKrfFFMSmecblk=; b=QP8/6/FyGuMoI8BVdWaXTzrZIrjeBiSTH7oYdwMCeSv9V0g6C9ZYap9hRfBtl9vyPlMIEe glVXyDIPN3ozdvbFptIrKvZVgq43jjJMMLej2ab5OoWlEWD9SE6jj17Op7u6tyHuxaQQkl t2v8R+XPCMcoeXV01dNrse/X2fvyX6c= X-MC-Unique: lxxAJMGFMoe-t9xOPtJuNQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 4/4] tools: be more paranoid about possibly NULL description Date: Wed, 22 Jul 2020 18:21:42 +0100 Message-Id: <20200722172142.1847640-5-berrange@redhat.com> In-Reply-To: <20200722172142.1847640-1-berrange@redhat.com> References: <20200722172142.1847640-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.11 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) GCC 10 complains about "desc" possibly being a NULL dereference. Even though it is a false positive, we can easily avoid it. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Laine Stump Reviewed-by: Michal Privoznik --- tools/vsh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/vsh.c b/tools/vsh.c index 527c135424..b65e99cbd2 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -689,7 +689,7 @@ vshCmddefHelp(vshControl *ctl, const vshCmdDef *def) fputc('\n', stdout); =20 desc =3D vshCmddefGetInfo(def, "desc"); - if (*desc) { + if (desc && *desc) { /* Print the description only if it's not empty. */ fputs(_("\n DESCRIPTION\n"), stdout); fprintf(stdout, " %s\n", _(desc)); --=20 2.24.1