standardizing on binary units

Rich Felker dalias at aerifal.cx
Tue May 2 07:31:20 PDT 2006


On Tue, May 02, 2006 at 08:42:43AM -0400, Robert P. J. Day wrote:
> 
>   another aesthetic nitpick but, if include/libbb.h is going to define
> the enumeration constants:
> 
> enum {
>     KILOBYTE = 1024,
>     MEGABYTE = (KILOBYTE*1024),
>     GIGABYTE = (MEGABYTE*1024)
> };
> 
> it only makes sense that busybox code should start using those
> constants, rather than constantly reproduce numeric constants like
> "1024", "65536" and so on.  however, while this might seem nitpicky,
> it's not that simple.
> 
>   first, the above enum constant definitions are simply wrong.  1024
> is not equivalent to a "kilobyte", it's equivalent only to a "kilo" if
> you want to be pedantic about it.  there's nothing that requires that
> value to refer specifically to a number of *bytes*.  but that's not
> the biggest problem.

This is a huge controversy and you're (I hope) on the losing side. In
any case the -h options are standardized and are supposed to use the
correct, traditional meanings for k/M/G/etc., not this new SI
nonsense.

Rich



More information about the busybox mailing list