[patch] save ~600B
Rob Landley
rob at landley.net
Tue Jun 6 16:16:48 PDT 2006
On Monday 05 June 2006 8:08 am, walter harms wrote:
> personally i am the fan of
> exit( EXIT_FAILURE ) ;
Unix-like systems have returned at least 8 bit error codes with 0 meaning
success and nonzero meaning failure since 1970. (In 1969, it was 6 bit. :P)
This was copied by DOS, Windows, OS/2, you name it. Any system that can't
handle that is one that BusyBox should not even attempt to support.
Also, filehandles 0, 1, and 2 are stdin, stdout, and stderr respectively, and
a null pointer is 0, and FALSE is 0, and any nonzero value is true.
(Although if they define a TRUE macro it could be 1 or -1 since -1 is all
bits set so it makes a certain amount of sense. You can trust our ENABLE
values to be 1 if they're true, though.)
char defaults to unsigned (because we hit the compiler on the head with a
HAMMER, that's why). Integer arithmetic uses ones' complement notation. We
restrict our use of floating point as much as possible and have config
options around any uses of it such as "sort".
Busybox trusts that the c99 types for uint8_t, uint16_t, uint32_t, and
uint64_t are all available, plus the corresponding signed ones. You can also
use c99 // comments. Our compiler must be capable of doing dead code
elimination and simple local constant propagation. It's not currently
merging duplicate strings or eliminating unused static functions, which is
sad.
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list