2 ms·
"And yes I saw the thing about Plan 9 compiling a kernel for all arch's with no ifdefs - well they only way you can do that is by cheating and either making you
by devin 17y ago
"And yes I saw the thing about Plan 9 compiling a kernel for all arch's with no ifdefs - well they only way you can do that is by cheating and either making your own preprocessor, or a fancy makefile. So big whoop."
I think that's a rather reductionist assessment. See:
http://ntu.csie.org/~piaip/plan9/archives/000005.html http://ntu.csie.org/~piaip/plan9/archives/000005.html
- ars 17y ago"Conditional compilation, even with #ifdef, is used sparingly in Plan 9. The only architecture-dependent #ifdefs in the system are in low-level routines in the graphics library." So, in other words - yah, you need need a preprocessor with ifdef's, because sometimes there is no other way to do it. And in other places he basically says he avoided ifdef's by using a fancy makefile, which doesn't seem an improvement to me, since the makefile essentially becomes a (less flexible) pre-processor. The point about dead-branch pruning instead of ifdef is well taken though. (But there are cases where that doesn't work.)