From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 994501FF39E for ; Fri, 7 Jun 2024 13:49:33 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 62EDC1E771; Fri, 7 Jun 2024 13:50:06 +0200 (CEST) Message-ID: <3d128b6a-9708-47ed-9313-04d25e4cc2ce@proxmox.com> Date: Fri, 7 Jun 2024 13:49:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Jing Luo , pve-devel@lists.proxmox.com References: <20240607094734.3883693-1-jing@jing.rocks> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20240607094734.3883693-1-jing@jing.rocks> X-SPAM-LEVEL: Spam detection results: 0 AWL -0.059 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH pve-qemu-kvm] patch: pbs block driver: correct a data type X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Hi, if you haven't already done so, please send a signed copy of the Harmony CLA to office@proxmox.com, see [0]. Am 07.06.24 um 11:43 schrieb Jing Luo: > gcc warns (-Werror=type-limits) that it will always be false for the > if statement. This is because here s->aid is defined as char, while > proxmox_restore_open_image() returns an int. Change the type to int. > Strangely gcc warns it on arm64 build but not amd64 build... > Thank you for the report! > Signed-off-by: Jing Luo > --- > ...2-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/debian/patches/pve/0032-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch b/debian/patches/pve/0032-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch > index b9578ba..9e68167 100644 > --- a/debian/patches/pve/0032-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch > +++ b/debian/patches/pve/0032-PVE-Add-PBS-block-driver-to-map-backup-archives-into.patch > @@ -68,7 +68,7 @@ index 0000000000..dd72356bd3 > + > +typedef struct { > + ProxmoxRestoreHandle *conn; > -+ char aid; > ++ int aid; > + int64_t length; > + > + char *repository; I'd rather make it an explicit uint8_t here (because that is the type for other functions taking the aid as a parameter, e.g. proxmox_restore_get_image_length()). And to fix the original issue, I'd use the ret variable to store the result from proxmox_restore_open_image() and only assign to s->aid after checking that the returned value is not an error and that it is small enough to fit into uint8_t. [0]: https://pve.proxmox.com/wiki/Developer_Documentation#Software_License_and_Copyright Best Regards, Fiona _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel