From owner-freebsd-arch@FreeBSD.ORG Wed Jun 28 10:33:00 2006 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E41E316A5DF for ; Wed, 28 Jun 2006 10:33:00 +0000 (UTC) (envelope-from andrew@areilly.bpc-users.org) Received: from omta04ps.mx.bigpond.com (omta04ps.mx.bigpond.com [144.140.83.156]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65E3544606 for ; Wed, 28 Jun 2006 10:15:03 +0000 (GMT) (envelope-from andrew@areilly.bpc-users.org) Received: from areilly.bpc-users.org ([141.168.7.22]) by omta04ps.mx.bigpond.com with ESMTP id <20060628101502.EPVK22738.omta04ps.mx.bigpond.com@areilly.bpc-users.org> for ; Wed, 28 Jun 2006 10:15:02 +0000 Received: (qmail 11627 invoked by uid 501); 28 Jun 2006 10:08:24 -0000 Date: Wed, 28 Jun 2006 20:08:24 +1000 From: Andrew Reilly To: Poul-Henning Kamp Message-ID: <20060628100824.GA1326@duncan.reilly.home> References: <20060628094221.GA50978@comp.chem.msu.su> <75461.1151488426@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <75461.1151488426@critter.freebsd.dk> User-Agent: Mutt/1.4.2.1i Cc: Yar Tikhiy , arch@freebsd.org Subject: Re: SET, CLR, ISSET in types.h for _KERNEL builds X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2006 10:33:01 -0000 On Wed, Jun 28, 2006 at 09:53:46AM +0000, Poul-Henning Kamp wrote: > In message <20060628094221.GA50978@comp.chem.msu.su>, Yar Tikhiy writes: > >On Tue, Jun 27, 2006 at 01:58:17PM -0600, M. Warner Losh wrote: > > >> NetBSD recently added SET, CLR, ISSET to sys/types.h (only if _KERNEL > >> is defined). > > As one of the people who have worked with the original /bin/sh source > code, I have a slight alergic reaction to attempts to paste over > the implementation language with macros like these. > > Setting a bit in 'C' is spelled > variable |= bit; > not > SET(variable, bit); To my eye, if you're going to use "bit" to describe which bit is being operated on, then you should *really* be doing: variable |= (1 << bit) and, obviously, SET(variable, bit) should do that, rather than what has been proposed. What you're spelling, above, and what the NetBSD macros that Warner described do are actually doing: SET(variable, mask). Compatability is a good thing, and if it's convenient to have NetBSD compatability macros, then go do it, but I think that it's important that they advertise what they're doing correctly. (Like the colour now?) Cheers, -- Andrew