Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp183454imm; Thu, 6 Sep 2018 00:15:07 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbaWB9HqEH3Q0ONnjPhssb3XPt0LkobZ9+KJybwXTSSB/GQBYLX3H1F+46oy6Krf+liH2Fl X-Received: by 2002:a63:c00b:: with SMTP id h11-v6mr1339744pgg.279.1536218107258; Thu, 06 Sep 2018 00:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536218107; cv=none; d=google.com; s=arc-20160816; b=LxD+UI8JSQAXGuRqMPu1v2iLCa75Lad5xvVnvS5bwlWscD4Pn5RpIYzUK/DACqGwc1 lEndAIF8zvZ83fnYnFEsUiwh3bhcyeGTOhVa33aecv4K/2KgrtAOsHRZUFQk/PtP+DfP +Y3Jr6Z3B1vpe0u9avTgN/xK+kIE/fEDPDl2T5Hym1y+jN0KcdiauBB3aAMFsIpPkH4K MnrBi8jXIWn2VV65iVXX0FefAYo3HuGpqs7lFmmfWyggnmQ8K8MlptFai6rkWQrE6vPR NdlIdkKf9YPVJ7Zo5YeCOVak/+Mzlt4VkdWWKJ7+kA2BhaQnZ4k8hNyGFq41PAkt2afZ mLKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:organization:references:in-reply-to:date:cc:to:from :message-id; bh=6a300fRUZk04ZI3lRIEQ/pBJNUlwH2CM+DJbUkSD4pY=; b=oZQ+qgiGzcI2HBM/dNL4kHJkSjwIdvc/kO8wGsKksEI8HOnkBdMtdozopfXeXfHbNq 1W/0mQ1EDLu+cU4GW8Te3X6IceooQHhjSN/wczSxsl1ZhKe5T2cydZ33GsKoZqMuYjHQ o7qhftskjKY5jg8drckPzis1dve9ryi/4dIeXogi5Yzx5d5mxqRHuqhKQKft9b/A0v1O N523VnK05YjUtXBiQ2UzpxiuKW7ibvsPBb6v8VqSTHqfvwy/h2jzkpiQlsLHzR8YIfId 23Owcdt1+r93ItQAZM87ZGFHMJjVA0+qwb4ENJYjcfn7y2mTgPvSr9ETUxmeyU0GjpdF tfqA== ARC-Authentication-Results: i=1; mx.google.com; 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 q28-v6si4293632pgm.689.2018.09.06.00.14.51; Thu, 06 Sep 2018 00:15:07 -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; 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 S1726496AbeIFLrs (ORCPT + 99 others); Thu, 6 Sep 2018 07:47:48 -0400 Received: from ou.quest-ce.net ([195.154.187.82]:42388 "EHLO ou.quest-ce.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbeIFLrr (ORCPT ); Thu, 6 Sep 2018 07:47:47 -0400 Received: from [37.170.112.156] (helo=test.quest-ce.net) by ou.quest-ce.net with esmtpsa (TLS1.1:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1fxoTT-000CKb-CG; Thu, 06 Sep 2018 09:13:08 +0200 Message-ID: <48b8af08170fb896c12cc4e3eae7501b4fa4181d.camel@opteya.com> From: Yann Droneaud To: Greg KH , David Howells Cc: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org, Michal Marek , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, keyrings@vger.kernel.org, David Airlie , linux-nilfs@vger.kernel.org, linux-nvdimm@lists.01.org, "Michael S. Tsirkin" , codalist@coda.cs.cmu.edu, coda@cs.cmu.edu, coreteam@netfilter.org, Rob Clark , linux-arm-msm@vger.kernel.org, Kent Overstreet , Dan Williams , Takashi Iwai , linux-bcache@vger.kernel.org, Coly Li , Jaroslav Kysela , Jan Harkes , Masahiro Yamada , Ryusuke Konishi , Jason Wang , Mat Martineau , netfilter-devel@vger.kernel.org, linux-fsdevel@vger.kernel.org, moderated for non-subscribers , freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Date: Thu, 06 Sep 2018 09:12:58 +0200 In-Reply-To: References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> <20180905165552.GB25206@kroah.com> Organization: OPTEYA Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-1.fc28) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 37.170.112.156 X-SA-Exim-Mail-From: ydroneaud@opteya.com X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on ou.quest-ce.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham version=3.3.2 Subject: Re: [RFC] UAPI: Check headers by compiling all together as C++ X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ou.quest-ce.net) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le mercredi 05 septembre 2018 à 19:33 +0200, Yann Droneaud a écrit : > Le mercredi 05 septembre 2018 à 18:55 +0200, Greg KH a écrit : > > 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? > > > > And if userspace wants to do this, can't they do the C namespace > > trick > > themselves when they do the import? That must be how they are > > doing it > > today, right? > > > > They can't. > > > Adding extern "C" { } doesn't magically make "class" a non keyword. > Even if it was the case, writing C++ code using whatever->class would > probably broke because class is a keyword in C++. > For the record, libX11 has to handle the kink pf issue with C++ keyword: https://gitlab.freedesktop.org/xorg/lib/libx11/blob/733f64bfeb311c1d040b2f751bfdef9c9d0f89ef/include/X11/Xlib.h#L227 typedef struct { XExtData *ext_data; /* hook for extension to hang data */ VisualID visualid; /* visual id of this visual */ #if defined(__cplusplus) || defined(c_plusplus) int c_class; /* C++ class of screen (monochrome, etc.) */ #else int class; /* class of screen (monochrome, etc.) */ #endif unsigned long red_mask, green_mask, blue_mask; /* mask values */ int bits_per_rgb; /* log base 2 of distinct color values */ int map_entries; /* color map entries */ } Visual; Regards. -- Yann Droneaud OPTEYA