Date: Tue, 28 Mar 2006 22:58:44 +0200 From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: John Baldwin <jhb@freebsd.org> Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/i386/include atomic.h Message-ID: <863bh2wakb.fsf@xps.des.no> In-Reply-To: <200603281501.08699.jhb@freebsd.org> (John Baldwin's message of "Tue, 28 Mar 2006 15:01:05 -0500") References: <200603281434.k2SEYmaR031447@repoman.freebsd.org> <200603281358.26703.jhb@freebsd.org> <86acbawerh.fsf@xps.des.no> <200603281501.08699.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin <jhb@freebsd.org> writes: > On Tuesday 28 March 2006 14:28, Dag-Erling Sm=F8rgrav wrote: > > which uses uintptr_t, not actual pointers, to avoid warnings. In > > effect, that code is broken. > No, it's on _purpose_, because we do arithmetic on the value (setting > flags, etc.) We happen to use curthread as our cookie value, but > the cookie is an integer, not a pointer. OK. PEBKAC on this end, then. > > Apply the attached patch, see how far a buildkernel gets... > Your patch could break the kernel, as it doesn't say that the value > being modified is volatile (volatile void ** !=3D volatile uintptr_t *). > I can't even get cdecl to tell me how to declare a pointer to a volatile > void pointer. uh, it's supposed to be void * volatile * of course. > > The latter only works because libthr is built with warnings disabled. > > I just finished working on making it build at WARNS level 2; higher > > levels will require a major overhaul, because the kernel interface it > > uses is fundamentally broken. > No, it needs to use the correct casts. We've been through this, the > atomic(9) manpage covers it, etc. libthr is broken for reasons mostly unrelated to atomic.h. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?863bh2wakb.fsf>