[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/3] xen/efi: fix unitialized use warning
- To: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 17 Apr 2023 10:40:50 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4xQLTxjkGweer8XTiy7zr0tqVBIDnHqVEj33+A0p7VY=; b=GW8NxJJY2Kd7ahPd3aXVesO5zjO+APcEzgRHyKb0QjDYBYld/oi0QGnqDCh+nEzisxAQfpBcBnZLGtQIX2xDCyri9nBqRhHDEniydkE5GNNtezpTt4EFlGOXpySixWzONv7I6vUMKGsxFKtPyIK+Y3jkQdoxbiZl6ulVsZ7VoIoLzKVBLCi67JinKLKvAwZQ1JoQ8eHlSqPX3iF3Xzf+yv6EFXbT8Yfht1J/SlkPLTCo026AgDvCJgQtqoW1AvNDmcMPJGHQqibhlWW+CePucjHh5TUz+8fDljuK7ArE4OgvKQkQ5T+VpMsZ3yHakU6HWkColktdcAFB2lZKXhi+wA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BLSqiu/MAuOKOQFNbaXTxbspXVVKG5GyeYoNV4j7xRXcFX+mHtaIuyweWBKfd3XC5AntNeJYMAWaQd4OfrTwcygpVepBh0RP9abCf9Yhe6Ro2SiDDfeaP7alqboJeO4th6JYip7k7JqKHOlRsEuG5ShgQw0AtP/hSJ9fKe8lMd4zUyg8C+I6v0lcDSNy7Qe8N0rQhZ+NPyShf/+ktU7z1Ug7yTPKguhME8cq5Ghu1VeUs3Y9yp/58OZzcnr1hpQ/x53SLDCn7ecuW1brF/0geZAwKW3Kj6xBRjI27KoK4GaWQ2oGUwrbskb19SvBGfnnaUwp09TSC0H9PP/VdZSTuA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Mon, 17 Apr 2023 08:41:39 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 14.04.2023 20:57, Stewart Hildebrand wrote:
> When building the hypervisor for arm64 with -Og, we encounter a (false)
> uninitialized use warning:
>
> arch/arm/efi/boot.c: In function ‘efi_start’:
> arch/arm/efi/boot.c:1468:9: error: ‘argc’ may be used uninitialized
> [-Werror=maybe-uninitialized]
> 1468 | efi_arch_handle_cmdline(argc ? *argv : NULL, options, name.s);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/arm/efi/boot.c:1263:21: note: ‘argc’ was declared here
> 1263 | unsigned int i, argc;
> | ^~~~
> cc1: all warnings being treated as errors
>
> Fix this by initializing argc. As a precaution, also initialize argv.
I'm not happy about this kind of change, and I also wonder whether we
wouldn't better use initializers for both variables if we already have
to work around compiler shortcomings like this one. Nevertheless I can
see the need, so ...
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
Jan
|