[Toybox] Commit 897: size reduction, and new warning

idunham at lavabit.com idunham at lavabit.com
Sat May 11 23:58:12 PDT 2013


I'm impressed:
-rwxr-xr-x 1 143640 May 11 23:16 toybox
-rwxr-xr-x 1 252748 May 10 21:32 toybox-895
-rwxr-xr-x 1 166499 May 11 23:16 toybox_unstripped
(Coincidentally, this is the output of ls -lgo with coreutils;
toybox appears to have no way to do a full ls with neither group nor
owner...but I'd expect that one could deal with that via pipes.)

No config changes, and the list of applets is constant:
for i in ./toybox*; do $i |md5sum ; done
58671088549e63bde77622705dc677af  -
58671088549e63bde77622705dc677af  -
58671088549e63bde77622705dc677af  -

So a change of less than 30 lines nearly halved size.
But gcc is warning about line 21 of lib/getmountlist.c:
  for (mtlist = 0; me = getmntent(fp); mtlist = mt) {

Output of make:
scripts/make.sh
Make generated/config.h from .config.
Extract configuration information from toys/*.c files...
Generate headers from toys/*/*.c...
generated/newtoys.h
generated/globals.h
generated/help.h
Extract help text from Config.in.
Library probe...
Compile toybox...
lib/getmountlist.c: In function 'xgetmountlist':
lib/getmountlist.c:21: warning: suggest parentheses around assignment used as truth value
toys/pending/stat.c: In function 'check_type_file':
toys/pending/stat.c:84: warning: control reaches end of non-void function

The latter warning is GCC nonsense, I know.
So gcc seems to be assuming that the condition is 
"While assigning the result of getmntent(fp) to me succeeds."
Am I missing something here, or should that have been "=="?

Thanks,
Isaac Dunham


 1368341892.0


More information about the Toybox mailing list