Date: Thu, 13 Jun 2019 20:16:04 +0300 From: Dmitry Chagin <dchagin@freebsd.org> To: =?UTF-8?Q?T=C4=B3l_Coosemans?= <tijl@freebsd.org> Cc: Dmitry Chagin <dchagin@freebsd.org>, Gleb Smirnoff <glebius@freebsd.org>, Warner Losh <imp@bsdimp.com>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r348847 - head/sys/sys Message-ID: <CAC0jpUBFnMRQW507Ds2u1WCfdu6PP9YxLWOhM62HKDG-20juBg@mail.gmail.com> In-Reply-To: <20190613104310.1b0f8f70@kalimero.tijl.coosemans.org> References: <201906100528.x5A5S4gm072561@repo.freebsd.org> <20190610110909.3e6fbc13@kalimero.tijl.coosemans.org> <20190612224255.GA67242@FreeBSD.org> <CANCZdfrox5-Va1WUdf4y-Oe2qQ-XsXC9QfsDCRRHhAPXkihEhw@mail.gmail.com> <20190613104310.1b0f8f70@kalimero.tijl.coosemans.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, All! thanks for reply, I will be back in a week and fix it, I am rafting in Eastern Siberia)) =D1=87=D1=82, 13 =D0=B8=D1=8E=D0=BD=D1=8F 2019 =D0=B3. =D0=B2 11:43, T=C4= =B3l Coosemans <tijl@freebsd.org>: > On Wed, 12 Jun 2019 16:51:03 -0600 Warner Losh <imp@bsdimp.com> wrote: > > On Wed, Jun 12, 2019 at 4:49 PM Gleb Smirnoff <glebius@freebsd.org> > wrote: > >> On Mon, Jun 10, 2019 at 11:09:09AM +0200, T=C4=B3l Coosemans wrote: > >>>> Date: Mon Jun 10 05:28:03 2019 > >>>> New Revision: 348847 > >>>> URL: https://svnweb.freebsd.org/changeset/base/348847 > >>>> > >>>> Log: > >>>> Use C11 anonymous unions. > >>>> > >>>> PR: 215202 > >>>> Reported by: glebius > >>>> MFC after: 2 weeks > >>>> > >>>> Modified: > >>>> head/sys/sys/ucred.h > >>>> > >>>> Modified: head/sys/sys/ucred.h > >>>> > >>>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > >>>> --- head/sys/sys/ucred.h Mon Jun 10 05:09:34 2019 (r348846) > >>>> +++ head/sys/sys/ucred.h Mon Jun 10 05:28:03 2019 (r348847) > >>>> @@ -89,12 +89,11 @@ struct xucred { > >>>> gid_t cr_groups[XU_NGROUPS]; /* groups */ > >>>> union { > >>>> void *_cr_unused1; /* compatibility with old ucred *= / > >>>> - pid_t _pid; > >>>> - } _cr; > >>>> + pid_t cr_pid; > >>>> + }; > >>>> }; > >>>> #define XUCRED_VERSION 0 > >>>> > >>>> -#define cr_pid _cr._pid > >>>> /* This can be used for both ucred and xucred structures. */ > >>>> #define cr_gid cr_groups[0] > >>> > >>> Isn't this a userland header that should work with non-C11 compilers? > >> > >> It could make sense to keep such low bar for standard headers, but > ucred.h > >> is BSD-specific header and struct xucred is FreeBSD specific. > > > > This is solvable with proper visibility, I'd think.. > > I think "union {" should be replaced with "__extension__ union {". That > seems to kill this warning: > > /usr/include/sys/ucred.h:90:2: warning: anonymous unions are a C11 > extension > [-Wc11-extensions] > union { > ^ > 1 warning generated. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAC0jpUBFnMRQW507Ds2u1WCfdu6PP9YxLWOhM62HKDG-20juBg>