Re: SET, CLR, ISSET in types.h for _KERNEL builds



In message <20060628094221.GA50978@xxxxxxxxxxxxxxxx>, 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@xxxxxxxxxxx | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: The War On HLA
    ... If you're assuming that macros' only purpose is for "in-line" functions, ... languages demonstrate the ability of using macros to extend the language. ... I would ask why you're using Delphi in the first place. ... programming language (i.e., you can assign them to variables, ...
    (alt.lang.asm)
  • Re: macro for shorter array syntax
    ... How is OCaml on adding readmacros, which Lisp can do easily. ... I would not ask that of a parsed language. ... We're confident that using macros is useful to us, ... debate has legitimate points on both sides. ...
    (comp.lang.lisp)
  • Re: LSE64 in standard Forth
    ... The cost of an additional add verses the cost of: ... language and the benefits and pitfalls of that language. ... LSE64 forces a lot more naming of things than Standard Forth, a thing I consider positive, but some in the group have criticized. ... The problem I have with macros is one well known in the C community: while a macro names a concept, it does not automatically provide a clean interface. ...
    (comp.lang.forth)
  • Re: Hey, what is all this off topic posting?
    ... >>> that's all you're using macros for, I can see why you don't much like ASM. ... > PL/I language constructs though. ... >> write the macros using some arcane assembler to do that on a new ...
    (sci.electronics.design)
  • Re: Python syntax in Lisp and Scheme
    ... >>expressive power because you believe it will be misused. ... people programming languages, both on the job and as a University ... that, Macros are just one. ... number of lines of code per year regardless of the language they write ...
    (comp.lang.python)

Quantcast