Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp37075imm; Thu, 13 Sep 2018 15:14:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaTRL+13beII2gR2MfiRW/y2A0UBXIwzrrgLUIOyW0/Ztj6FxmHRkc6n2+z/lULwr9SrAls X-Received: by 2002:a62:68c3:: with SMTP id d186-v6mr9284722pfc.70.1536876864909; Thu, 13 Sep 2018 15:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536876864; cv=none; d=google.com; s=arc-20160816; b=onFkPBnbZKSUbZw0eCLOSpNE7hEb+Ib5G9rHHMGcpHYb9lbVk4foYW1QYKfj8p80Xq UxlYwdZUx8bJm89bx5obJMVe65lL/SRLsj5lHVLsm+U1SBonMqMTIN+bPVJ8d5+c8KPX zPf9UFUsRXOEBjOqxbCEFlMJC7T34j0Y7PC+nnNRpayQ1/dUKfRFR6T8xcHA6n6lPVVB RavROlL7Vp9QTYEvPTElsEMmsC4GMsAd93EoB3GrEd7i+mBnTOVPktslRDQQOKnYgxPW L2e4vVn2KQa/2O8SPUK4h5htmZYGuwYvbaPYsnncTsp5QoE9AarIL3o9VQUX3gfVg8P/ uXrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=golBgE3OWJfANA4Cb9GGvuo39/Fbuzy8PVgvnBVygEw=; b=Oz4fmeYvP2wkBEE8FTgUgmE0vTfhcQKNm4hUNLTFtdwxeWUlQCkSaX23AFQZ3JwDGm J27E46obuMJE4WJqPB8LRLH9uYRceQuEQzlVokQIw3i4RVGqdcUznV/tHBr+ZmiSv8v0 tuDygBFoeFavmaQkogFJAN1U0OhR3OCkjA01Q398rRXuVKQoSTUb3iQdZNxk4MVeZitc KQoIQZcSwlTcMeM/vTixBAwmhCJenljdsTqdy04HIHBh9vkIluInP4HQA6s2swF2YtUE McJT4ywQ8xoVhqzgGHs2ln7sULBNTfpwVczP3qFvX0YBB6pFWqGb3avZUu6rlOhcSTl+ 0l+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EvLUns0V; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si5064616plz.351.2018.09.13.15.13.22; Thu, 13 Sep 2018 15:14:24 -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=pass header.i=@gmail.com header.s=20161025 header.b=EvLUns0V; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728049AbeINDMv (ORCPT + 99 others); Thu, 13 Sep 2018 23:12:51 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40738 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727417AbeINDMv (ORCPT ); Thu, 13 Sep 2018 23:12:51 -0400 Received: by mail-wr1-f65.google.com with SMTP id n2-v6so8302647wrw.7 for ; Thu, 13 Sep 2018 15:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=golBgE3OWJfANA4Cb9GGvuo39/Fbuzy8PVgvnBVygEw=; b=EvLUns0VVCSaFmoIenO0yO/E/2jDPbQGeiUbiNymyLw/Ub79XIB64TsLwdrDCD/8Ti YbvZF29hlhwZHrJhwQe8kmrsdeb1TbHae4lEH24dWVaZpYKbqxF6M3VXMCFDow0l/Ksi PxmwoigB4QKsY1Nwdp0B0zPXPArpMOxXN8CpLTGuI+Sq3xoH2s3pQGYnWWSoArAjN+No a9E4dCdAqL+cXs5ctmYf09kTSqP9VRVXY4Hhfs8DITgA4gP0M/12MDLuItSiPN3wkcSP hCYi0O4I9c5cvIRb2jjdEWbP/YVn0JRmP+oMlyS3rEm4cNKbwB5AZz3i4m/TRAXcd8mI LnMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=golBgE3OWJfANA4Cb9GGvuo39/Fbuzy8PVgvnBVygEw=; b=khhFvxXSSYFtUL2n8sCQMarr3k8J/E7cpGb6U7BP51PnmAwxdBUo8CdiqT88G73+y3 achJspBuvhs9JJHuVwE5PDLASCeF8POW7VdRLjevGvr/x07YBVsbjxdf0pS9deepMOBj 9lFELR0j7LKTAXkYOHiuyWvobC3CuT6nRokcAd/6Ku2fgQYbDnVYFkiAXK2+H7q+cM3W xahhgglVcBGU+o+aLUPwDSXIZN0d7U+i5qWHQ4opaARHmY4He7k2jEgGcu37gbZ5qRrv RXiOHHXHkTNsK6tvXwLH/77sCMyvPQWCqfC1BvkXUbusEj0B10gBkOih+wg5e0B+GzR0 w9xA== X-Gm-Message-State: APzg51DxVkXzOl9nLqd4glYGNFQUUR+YrZ/o+tbBhVDROT+0jqqfnZMz WgGadlt6tnTiiyUsVEYrEBD+y8w= X-Received: by 2002:a5d:6550:: with SMTP id z16-v6mr6965319wrv.194.1536876087008; Thu, 13 Sep 2018 15:01:27 -0700 (PDT) Received: from avx2 (nat4-minsk-pool-46-53-177-92.telecom.by. [46.53.177.92]) by smtp.gmail.com with ESMTPSA id 132-v6sm26905wmd.13.2018.09.13.15.01.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Sep 2018 15:01:26 -0700 (PDT) Date: Fri, 14 Sep 2018 01:01:24 +0300 From: Alexey Dobriyan To: Al Viro Cc: Greg KH , linux-kernel@vger.kernel.org, dhowells@redhat.com Subject: Re: [RFC] UAPI: Check headers by compiling all together as C++ Message-ID: <20180913220124.GA12570@avx2> References: <20180905185922.GA25461@avx2> <20180905192636.GA13608@kroah.com> <20180905193111.GA27217@avx2> <20180905222247.GT19965@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180905222247.GT19965@ZenIV.linux.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 05, 2018 at 11:22:47PM +0100, Al Viro wrote: > On Wed, Sep 05, 2018 at 10:31:11PM +0300, Alexey Dobriyan wrote: > > On Wed, Sep 05, 2018 at 09:26:36PM +0200, Greg KH wrote: > > > On Wed, Sep 05, 2018 at 09:59:22PM +0300, Alexey Dobriyan wrote: > > > > > On Wed, Sep 05, 2018 at 04:54:27PM +0100, David Howells wrote: > > > > > > > > > > > > Here's a set of patches that inserts a step into the build process to make > > > > > > sure that the UAPI headers can all be built together with C++ (if the > > > > > > compiler being used supports C++). All but the final patch perform fixups, > > > > > > including: > > > > > > > > > > Wait, why do we care? What has recently changed to start to directly > > > > > import kernel uapi files into C++ code? > > > > > > > > I think David is seriously trying to compile kernel with C++ compiler > > > > and this is first step. > > > > > > > > He isn't alone. Resistance is futile. :^) > > > > > > "struct class" is going to be a hard one to overcome :) > > > > "struct class" makes you hostis publicus #1 of the Linux++ empire. :^) > > Don't tempt me... <= g++-8 doesn't support C99 style initializers. g++-8 mostly does: for example .foo = { [BAR] = 1, }, doesn't work, but regular .foo = 42 does. Additionally, g++ makes noise about order of initializators. C++20 is supposed to make things better. g++ supports -fpermissive which is a blessing. clang doesn't support -fpermissive which makes everything way more tedious and it has problems with alternatives (and IIRC vdso code). Now with gcc version bumped recently I think __attribute__((cleanup)) is supported which makes destructor-like behaviour possible: with_spinlock(&p->l) { return 0; } with_mutex(&m) { } with_rcu() { }