Received: by 10.213.65.68 with SMTP id h4csp1794333imn; Sun, 1 Apr 2018 15:22:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/oOkDG6ws2aEqXHREVCPVDUkpNxFvvOWQqzvGqcecp4iJjsZp2PACUeeSRyVSsln+EhUxY X-Received: by 10.99.63.205 with SMTP id m196mr4658675pga.82.1522621362641; Sun, 01 Apr 2018 15:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522621362; cv=none; d=google.com; s=arc-20160816; b=jJkJB9mYkNMm3cvwIQmjpgW4gMZGXucsmNtzWOKdRdNLgJdY8SJcI8JFWXDzE3Qc0K ZBjODjkFbCTnKX6rH544AVZ4pv+d+W9ifsSRc8aHAi0ff4yC/jOTdZJSAyFeNGhb8BnX lrTQol/l8gwvTIZL8s4bLAi+hWGUrr4egAisEHgylgmF7dfGE5s1+jPRbjroCrG1HyI6 3Q1GiPu7HiznLuSOYWeRnNSW5vcOYiuaeiRqfQltg3SG8x3JgmbuWxeZ7EOnHiYEDEEw F3dOgyGBVaoa+XWZ1xOafWP7AJjVEnumnYzrpqzYODSspVcC7hE4dHGZ7HQ0410cQ3TG y85w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature :arc-authentication-results; bh=VPihSlTna5O9vfYctt823xJNTWRCx0VWnM/vfrYBjng=; b=MCfmJg6bRORaP94Do3/oHx58iNiXQLlWUbkU8qa7U1xAetEHy9PcSN35CHoOy8E8wd 5w2+eczaALJhfB3xBxLVN4EfSZL3/IhVxl9tsLZh/4tbUvh9yRjPDwsmb+PrzRNpox+o 1x1iR8ZRc8MvMq2HbxTONoTKx7ikW6EI8M0wMcMeZCLEK8Z07Y1zQt8OUF30oW1iqn/G GFERBBecLN39a6UuteiFncCDkncywUs9ltW4ylNEjfiChkqks/3u7FAIcqXzUDmlPI86 kYVmUi7phooAlFzMM+3y/0JMVpfzQIHTC19CD3ig50HMMAc6EcBCe+iD3p5au81Tf3Vm ZaAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=g2XxeoY1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si8744951pgt.574.2018.04.01.15.22.26; Sun, 01 Apr 2018 15:22:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@infradead.org header.s=bombadil.20170209 header.b=g2XxeoY1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754033AbeDAWUf (ORCPT + 99 others); Sun, 1 Apr 2018 18:20:35 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40382 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753943AbeDAWUe (ORCPT ); Sun, 1 Apr 2018 18:20:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To: Subject:Sender:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=lSwJWA2l7DXV/BfRNmaoiHUI+vkOgI2GjFEGzpWkPB4=; b=g2XxeoY1cYU2Vl/jqgoELtDjK Af8qWWDpASAX0XR7lh0Nv0VB7glozUQrcStP7kus74i7e7Jjy2dx5rrw7O4jMFafWG/HqyfLMk2B7 Xe99EVfLPBN12c4Fg5EuMRLJDWqkuD5np112G/vONzt202PjzdbVRQosi38+O0rZYAtOEtU5jbGfJ fbdvjyXRkejuHmtDrp1qJOs5pZv5HpwkBgpcNfk+DsVbXB9CPYv4cHpIbGViYRqW56C2WePspJSDK wwGlR0hmnbrehTR+/9PhKTHUaHnHQf6TDbOTSMjAq0hGXCVb3rXLsCm++sSVPvABNHVtf5m5HGfWA H8cXXBSrw==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f2lKz-0003Cv-P4; Sun, 01 Apr 2018 22:20:33 +0000 Subject: Re: [PATCH 00/45] C++: Convert the kernel to C++ To: David Howells , linux-kernel@vger.kernel.org References: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> From: Randy Dunlap Message-ID: Date: Sun, 1 Apr 2018 15:20:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/01/2018 01:40 PM, David Howells wrote: > > Here are a series of patches to start converting the kernel to C++. It > requires g++ v8. > ... > > What I would disallow: > > (1) new and delete. There's no way to pass GFP_* flags in. > > (2) Constructors and destructors. Nests of implicit code makes the code less > obvious, and the replacement of static initialisation with constructor > calls would make the code size larger. > > (3) Exceptions and RTTI. RTTI would bulk the kernel up too much and > exception handling is limited without it, and since destructors are not > allowed, you still have to manually clean up after an error. > > (4) Operator overloading (except in special cases). > > (5) Function overloading (except in special inline cases). > > (6) STL (though some type trait bits are needed to replace __builtins that > don't exist in g++). > > (7) 'class', 'private', 'namespace'. Please fix https://bugzilla.kernel.org/show_bug.cgi?id=191051 while you are at it. :) > (8) 'virtual'. Don't want virtual base classes, though virtual function > tables might make operations tables more efficient. ta. -- ~Randy