[PATCH 2/2] mount: -T OTHERTAB support

Isaac Dunham ibid.ag at gmail.com
Wed Mar 11 18:14:50 UTC 2015


On Wed, Mar 11, 2015 at 04:11:27PM +0100, Denys Vlasenko wrote:
> On Wed, Mar 11, 2015 at 3:47 PM, Isaac Dunham <ibid.ag at gmail.com> wrote:
> > On Wed, Mar 11, 2015 at 10:21:26AM +0100, walter harms wrote:
> >>
> >>
> >> Am 11.03.2015 06:35, schrieb Isaac Dunham:
> >> > +0 bytes disabled, +56 enabled when DESKTOP is enabled (glibc/i386):
> >> > function                                             old     new   delta
> >> > .rodata                                           144949  144971     +22
> >> > packed_usage                                       30236   30256     +20
> >> > mount_main                                          1200    1214     +14
> >> > ------------------------------------------------------------------------------
> >> > (add/remove: 0/0 grow/shrink: 3/0 up/down: 56/0)               Total: 56 bytes
> >> >    text        data     bss     dec     hex filename
> >> >  757557        2068    9044  768669   bba9d busybox_old
> >> >  757593        2068    9044  768705   bbac1 busybox_unstripped
> 
> Applied, thanks!

Ok, I have two questions (one about the chanes to the patch, one general C)

First, why did the documentation for -w get turned off?

> >> > -   const char *fstabname;
> >> > +   char *fstabname = (char*)"/etc/fstab";
> >>
> >> i am curious why (char *) ?
> >
> > The cast is just to shut up GCC, since busybox has enabled an option that
> > makes GCC treat "string" as const char *.
> >
> > The architectural reason for using char * instead of const char *
> > is that -T makes fstabname variable (and it's simpler to use the same
> > declarations when practical).
> 
> The correct thing here is to use "const char*".
> 
> VAR in "const char *VAR" is _variable_ too, not constant.
> The constant pointer is declared like this: "const char *const CNST".

And second, I'm not really understanding what's constant when I write
"const char *".

I had thought that it meant that the pointer was immutable, and that
"char *const STRING" marked the contents of "STRING" as immutable. Is
that  backwards?

Thanks,
Isaac Dunham


More information about the busybox mailing list