Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2036901rdd; Thu, 11 Jan 2024 18:25:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IEN6pxZbziGmNNnFjle4kOYggAmUrZme1mnyqQs4jk8kQCtMTpTp71jBmegeoR3yQdvXNwZ X-Received: by 2002:a05:6214:501d:b0:67f:8267:3baf with SMTP id jo29-20020a056214501d00b0067f82673bafmr182231qvb.80.1705026319860; Thu, 11 Jan 2024 18:25:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705026319; cv=none; d=google.com; s=arc-20160816; b=wiWuzNo7Lw1Vlslxqf5ny5xp53Z87TgEq6mw12oGHcvVJ+qBHqmdpQaMYwAI2obP56 RY45QAY532I+6t6WFQAbGFoIS01sy2QStIguLxEkl8xssQwPp1uWKUd47aYUOJKOlQwS Zac+BBJRI4QcJSDV92pNIIUfNQPCUTQ3IXlXTJ2D/Ao5sZY9vijrA78LO/LrRAWG45kz g8VdqMkUk3CnrXRDuIM0kV/kxcIzuuDOU/0p/9I6pYfxmbpOyynzBKbeTvMMjqmsrNUW CB8n8Klym3jNLSqZuiYBSyKsHfs8rcUi9JxTZBBnv1zmaFyhfFwHOU1/i5+w4zf/lZwx nn2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-filter; bh=eXbAguUe+qR+bnHFYgNPuQMZxxGMYoKTlIbL/6KZHvQ=; fh=cxJ5nUZkhes7ilkBxu820d9Sg0k+SGZ2aQIXNT8ybhE=; b=EPk47IbfJaIKo3HvpsS9PetSt0uIXEj5297KDdhDdJYMbpII1BX6OonjD4QSKvISjR 7itU12B6lvOkCQ8yR5tmOOCfkRsUA37JgPqIilBb9wIYj0dpBcfGUjyM72Tcp2ejL6dg WX6lTphTtutyq4IITS9VXJiydXaa7QQS+5jfoRFkMrk4RjNQflQeIEeoP1Zd5kTTUTg9 e8IHDrWOlK5UAdGI8rRax7bCzECc3bD+HBbPonCxTWU2fHhrC+/rubBAK7gjcvpz8nH0 ygKMPXRBGCj5cos+fVdz/rP5lGC2BCC/m0U4i06ZEZEt3IZl5JESZIiwd8ByXyi0nHII YgKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2023121201 header.b="OfCc/uBG"; spf=pass (google.com: domain of linux-kernel+bounces-24231-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24231-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x7-20020a0ce247000000b0067f73c62cdcsi1994945qvl.227.2024.01.11.18.25.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 18:25:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24231-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2023121201 header.b="OfCc/uBG"; spf=pass (google.com: domain of linux-kernel+bounces-24231-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24231-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 871741C238BF for ; Fri, 12 Jan 2024 02:25:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8AA8C1379; Fri, 12 Jan 2024 02:25:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="OfCc/uBG" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B93D14F63 for ; Fri, 12 Jan 2024 02:25:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from [IPV6:2601:646:8002:4641:eb14:ad94:2806:1c1a] ([IPv6:2601:646:8002:4641:eb14:ad94:2806:1c1a]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 40C2P6aC044415 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Thu, 11 Jan 2024 18:25:07 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 40C2P6aC044415 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2023121201; t=1705026307; bh=eXbAguUe+qR+bnHFYgNPuQMZxxGMYoKTlIbL/6KZHvQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=OfCc/uBGev2Qbn8FPRU7cZ7KmyQJEEK3hjpEIIw3rcCTsY/u/F/oa6TJr6UpAJ0/y CfzNMhS/oIgmwKxuU5SPRCnt+oemabwfVK0A96oBl5XTGLRk4PlBk4e5bKbMRrdgp8 QLfp3z+MLo6veauPnUZIPQcNQjsXA8fF0WRZCmDffUGMu/Ww6Y+kvi9PdVGljVlzHM k1ZN1tbSnclx5Xnf1DmqukB/XgSwDkiYQG9FIX1hTNMalNxiIy3lMkBqOZQI+taXci IFCAzfFUXkreTT1jukjnuEV4CbV1z5mWKT30bePbinF67M1Edpm75rJaJwjjnEawwQ Zm1LwoofKPPrA== Message-ID: <866d8a95-d7ff-475d-b8c5-bcffed0dfa1d@zytor.com> Date: Thu, 11 Jan 2024 18:25:01 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 00/45] C++: Convert the kernel to C++ Content-Language: en-US To: David Howells Cc: pinskia@gmail.com, Alexey Dobriyan , linux-kernel@vger.kernel.org References: <3465e0c6-f5b2-4c42-95eb-29361481f805@zytor.com> <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> <1681813.1704843645@warthog.procyon.org.uk> From: "H. Peter Anvin" In-Reply-To: <1681813.1704843645@warthog.procyon.org.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/9/24 15:40, David Howells wrote: > >> Both C and C++ has had a lot of development since 1999, and C++ has in fact, >> in my personal opinion, finally "grown up" to be a better C for the kind of >> embedded programming that an OS kernel epitomizes. > > And gcc got rewritten in C++ some time back, so they have a vested interest. > Indeed. >>> (8) 'virtual'. Don't want virtual base classes, though virtual function >>> tables might make operations tables more efficient. >> >> Operations tables *are* virtual classes. virtual base classes make sense in a >> lot of cases, and we de facto use them already. > > You end up adding storage for a 'this' pointer for each virtual base class, I > think - and then you may have extra fun if you inherit from two classes that > both inherit the same virtual base class. Abstract base classes that are just > ops tables are probably fine, though. My apologies, I meant *abstract* base classes, not *virtual*. To be honest, I don't think I have ever used virtual base classes in any other application than games (relating to physical objects), and barely even then. -hpa