standardizing on binary units

Robert P. J. Day rpjday at mindspring.com
Tue May 2 14:50:48 UTC 2006


On Tue, 2 May 2006, Rich Felker wrote:

> 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.

actually, as hard as it may be to believe, i'm fairly indifferent to
what the final decision is, it would just be nice to use whatever that
decision is uniformly throughout the code, that's all.

rday



More information about the busybox mailing list