[Toybox] Regarding mkflags.c

김혜진 hj8296 at gmail.com
Tue Mar 3 23:03:08 PST 2015


Hi.

On cross compile, I found an abnormal operation of make.sh.

In a cross compile system, mkflags excutable gives wrong result code
although completely created generated/flags.h
So, it goes to "exit 1".

line 177 - 178 in scripts/make.sh
-------------------------------------------------------------------------------------------------

*done | sort -s | sed -n 's/ A / /;t pair;h;s/\([^ ]*\).*/\1 " "/;x;b
single;:pair;h;n;:single;s/[^ ]* B //;H;g;s/\n/ /;p' |\generated/mkflags >
generated/flags.h || exit 1*
---------------------------------------------------------------------------------------------------------------------------------------------

Because above, I analyzed mkflags.c to find the reason why mkflags gives
wrong result code.
The result is that main() returns nothing if it normally exits.
main() function has int return type and it affacts an build process  on a
system.

plz, have a look.


diff --git a/scripts/mkflags.c b/scripts/mkflags.c
index 454fc03..1ae4c40 100644
--- a/scripts/mkflags.c
+++ b/scripts/mkflags.c
@@ -206,4 +206,5 @@ int main(int argc, char *argv[])
     if (i<0) return 1;
     out += i;
   }
+  return 0;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20150304/8d8fe1ba/attachment-0002.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-scripts-mkflags.c-main-function-need-return-0-if-nor.patch
Type: application/octet-stream
Size: 541 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20150304/8d8fe1ba/attachment-0004.obj>


More information about the Toybox mailing list