[Toybox] [PATCH] Clean warnings generated by scripts/genconfig.sh

Georgi Chorbadzhiyski gf at unixsol.org
Mon Feb 27 16:45:36 PST 2012


The attached patch prevents warnings related to clone flags. According
to clone(2) _GNU_SOURCE must be defined before including <sched.h>.

After the patch the following warnings disappear:

   <stdin>:2:11: error: 'CLONE_NEWNS' undeclared here (not in a function)
   <stdin>:2:23: error: 'CLONE_NEWUTS' undeclared here (not in a function)
   <stdin>:2:36: error: 'CLONE_NEWIPC' undeclared here (not in a function)
   <stdin>:2:49: error: 'CLONE_NEWNET' undeclared here (not in a function)

-- 
Georgi Chorbadzhiyski
http://georgi.unixsol.org/
-------------- next part --------------
The following patch prevents warnings related to clone flags. According
to clone(2) _GNU_SOURCE must be defined before including <sched.h>.

After the patch the following warnings disappear:

  <stdin>:2:11: error: 'CLONE_NEWNS' undeclared here (not in a function)
  <stdin>:2:23: error: 'CLONE_NEWUTS' undeclared here (not in a function)
  <stdin>:2:36: error: 'CLONE_NEWIPC' undeclared here (not in a function)
  <stdin>:2:49: error: 'CLONE_NEWNET' undeclared here (not in a function)

diff -r 763d581badae scripts/genconfig.sh
--- a/scripts/genconfig.sh	Sun Feb 26 22:04:37 2012 -0600
+++ b/scripts/genconfig.sh	Tue Feb 28 02:39:12 2012 +0200
@@ -14,6 +14,7 @@
 
   echo -e "# container support\nconfig TOYBOX_CONTAINER\n\tbool" || return 1
   $CC -c -xc -o /dev/null - << EOF
+    #define _GNU_SOURCE
     #include <sched.h>
     int x=CLONE_NEWNS|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWNET;
 EOF


More information about the Toybox mailing list