lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <48b8af08170fb896c12cc4e3eae7501b4fa4181d.camel@opteya.com>
Date:   Thu, 06 Sep 2018 09:12:58 +0200
From:   Yann Droneaud <ydroneaud@...eya.com>
To:     Greg KH <greg@...ah.com>, David Howells <dhowells@...hat.com>
Cc:     linux-api@...r.kernel.org, linux-kbuild@...r.kernel.org,
        Michal Marek <michal.lkml@...kovi.net>,
        dri-devel@...ts.freedesktop.org,
        virtualization@...ts.linux-foundation.org,
        keyrings@...r.kernel.org, David Airlie <airlied@...ux.ie>,
        linux-nilfs@...r.kernel.org, linux-nvdimm@...ts.01.org,
        "Michael S. Tsirkin" <mst@...hat.com>, codalist@...a.cs.cmu.edu,
        coda@...cmu.edu, coreteam@...filter.org,
        Rob Clark <robdclark@...il.com>, linux-arm-msm@...r.kernel.org,
        Kent Overstreet <kent.overstreet@...il.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Takashi Iwai <tiwai@...e.com>, linux-bcache@...r.kernel.org,
        Coly Li <colyli@...e.de>, Jaroslav Kysela <perex@...ex.cz>,
        Jan Harkes <jaharkes@...cmu.edu>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Ryusuke Konishi <konishi.ryusuke@....ntt.co.jp>,
        Jason Wang <jasowang@...hat.com>,
        Mat Martineau <mathew.j.martineau@...ux.intel.com>,
        netfilter-devel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        moderated for non-subscribers <alsa-devel@...a-project.org>,
        freedreno@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC] UAPI: Check headers by compiling all together as C++

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ