Robert Millan <[EMAIL PROTECTED]> writes:
> busybox is one of the most unportable programs I ever seen.
It's pretty squished, yes.
> I don't think the #if directives would add much clutter. I don't
> know coreutils sources myself, but I believe that most of the code
> in them are GNU extensions.
Yes, probably. But I'm afraid that the extensions normally won't be
big blocks of code; they'll be scattered throughout the code. Lots of
ifdefs will give the coreutils maintainer fits.
> (could you give a more accurate estimation on that?)
It's nontrivial to estimate, I'm afraid.
> If my assumption is correct, the #if directive addition would mostly look like:
>
> #ifndef TINY
> [ bulk of code for extra features ]
> #endif
> [ code for common code to comply with POSIX ]
I suggest defining TINY (or better perhaps its antonym, EXTRAS) as
boolean constants, so that you can write this:
if (EXTRAS)
code_for_extra_features ();
as this will be easier to read than ifdefs. You can also use "#if
EXTRAS" if that's necessary, but typically "if (EXTRAS)" nests nicer
and has better compile-time checking.
My suggestion is to pick one nontrivial program ("cat", say) and try
to do just that one, to see if the coreutils maintainer has a heart
attack with the result.
_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils