[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen: let ASSERT_UNREACHABLE() WARN() in non-debug builds
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Wed, 24 Aug 2022 10:40:38 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=kwuAQpNcIRhn7bJZNrrmtgGwCaaN0+nBvbMogofl8EU=; b=iLVCWhEaXpJZv80fBzt8dtZRUXjbDu5HUIh9E4293XMSxfaPa+Og+EmLIUBbp/BjOPQZGCRRI59hf7zYwyvsxs+R6nUKQsZaj5e7yN0q3MyabeyWspR3I2paBNidMu+6g1OSJWtcXqbqdDKa6g7bfV+TXdL1DP5djOtzivPLo0LN+8gAMSE12TuKCR4zswvWRuES7T//0g36jo44LgrBVP254waYeLKneoHoaFmuY8m1zUdKot4frAZSZIfh7IMaWJkVICj2Xft+pvxmh5Y3BDcgCIfz0qQUpQUbwn1Enbad2ZRmEkJYw9DdZhzJwsi/5Iu4ak/WH0h4ZhnWWfNfFw==
- 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=kwuAQpNcIRhn7bJZNrrmtgGwCaaN0+nBvbMogofl8EU=; b=NgPFOXLrNeCEX4luCyAD8eri5E3QkWc2SbvdnL8CeUUT86sS7UWrWwZCyl9KhKAjyGAcJ+HDFlZP6HkF8nlTRi2iIwlHgGy27mqzV4yRJKGTR30NRSs4U3vgmxwzSlEps21x2laUe4VOeVMDNKNA6QoXY+qkUxJbvzyjJfdn7VilP/Abnp8rD4cijLYTwDTaY4qLWKKmRPE8tKMu/DEQY7GPulrzAi5ljiX4vBEgPZcDRG3bGcchW7oWaAusCj7akknU3rWxRCNvtJeBCfvaBqRX01npWebuQX7Id+Ho9C4vXt05PXchmmj1DiOGZ9P6CgpgNuitl2gCXDwXWYKJpg==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=BTSkJkj1NJ/LVFMLi56+uapV7JmaiAiOF/OTt4bjJGhpxJ6kByn/1LN95RitBJX6lYkYQLpUSo69cWOkvp/jmBAj8WFce3sK22R33H5p34a+9Ktd52E3WtMlOuXcAXwvwooqJkPDSiEptB86Pe9WExHsidL51vSQMjV3w0bdv4aU2bP2+JuVSlgkSj8l+lrh1dJJooC9iPdbD1l979qluEH6Bv6ZgAJQkVSU1hn2GnwBpuWe0oiOhn/B37pgoxepDTMcfzalTfyZvkALD0MLHRlcHTMTTfloS/JcNgEBg7tD+8R1C3QVUoNOUFv/OWrQKkxSDw0eEPo2pnpbjYTn3A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ao+yoWlaRQB6qPJADNxYZpdx2Vrwr4VT8673cJTydQ6jvH5uPX7Na8RtpAq20BvYvkTuS8bXijKwwAmwkx5IONBQQPkIbwLCRDthka8WbirCQMac3LUZvpvr3K3IUgz6jUbPdSbm5AsaxTW5J/1gNrbCwJi/1jQn0cYXVri5RnUhAqy4STnK07Q6b9z5z5U9KrOezh0UWRjdOKt9NRTVKYXoZCFccUxGZaVmPwFKem6CrcNTlfgMukvVnRilahV8GcuRR/INrxwcHmxNsRaGzcHtihYGghC1X00Wzy3qNSioChlBgWnPYP4KJNUcGVvLwRcc9STNXWIN21qpD/X05Q==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Juergen Gross <jgross@xxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 24 Aug 2022 10:41:06 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYt6NyK7b3RgMjVkS3bZkU2qcg36292w4AgAABj4A=
- Thread-topic: [PATCH] xen: let ASSERT_UNREACHABLE() WARN() in non-debug builds
Hi,
> On 24 Aug 2022, at 11:35, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 24.08.2022 12:22, Juergen Gross wrote:
>> Hitting an ASSERT_UNREACHABLE() is always wrong, so even in production
>> builds a warning seems to be appropriate when hitting one.
>
> I disagree, for two reasons: This violates the implication of NDEBUG
> meaning ASSERT() and friends expand to no actual code. Plus if doing so
> for ASSERT_UNREACHABLE(), why would we not do the same for ASSERT()?
> There's a reason we have ASSERT() and friends and, independently,
> WARN_ON() / BUG_ON() et al.
I agree with Jan here, this is introducing code in ASSERT which is not the
intention
and will end up with dead code in production mode.
In NDEBUG those should appear.
If something is needed or we think there could be a situation where this is
reachable,
then the code should be modified to use something else then
ASSERT[_UNREACHABLE]().
Bertrand
>
> Jan
>
|