Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2006 09:53:46 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Yar Tikhiy <yar@comp.chem.msu.su>
Cc:        arch@freebsd.org
Subject:   Re: SET, CLR, ISSET in types.h for _KERNEL builds 
Message-ID:  <75461.1151488426@critter.freebsd.dk>
In-Reply-To: Your message of "Wed, 28 Jun 2006 13:42:21 %2B0400." <20060628094221.GA50978@comp.chem.msu.su> 

next in thread | previous in thread | raw e-mail | index | archive | help
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);

Higher order macros like roundup(), ispow2() are fine with me,
because they implement something on top of the language and make
the source code more compact and thus faster to read.

But all of the three proposed macros take up more space than
the native language they obfuscate, what is the sense in that ?


If we want to have them for NETBSD compatibility, they should
be enclosed in 

	#ifdef NETBSD_COMPAT

	#endif

Or better yet: be put in sys/sys/netbsd_compat.h


-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?75461.1151488426>