[ISOLATED] Re: was error in latest build, svn 15200: Enable getopt long

Robert P. J. Day rpjday at mindspring.com
Sun May 28 20:18:12 UTC 2006


  ok, i've somewhat isolated the problem with the build error in
hdparm.c.  starting with "make allnoconfig", i then configured to just
add in "hdparm" and, as i reported earlier, what i got was:

=================================
...
  CC miscutils/hdparm.o
In file included from /home/rpjday/bbx/busybox.new/miscutils/hdparm.c:29:
/usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include <endian.h> instead!
In file included from /usr/include/arpa/inet.h:23,
                 from /home/rpjday/bbx/busybox.new/include/platform.h:125,
                 from /home/rpjday/bbx/busybox.new/include/libbb.h:14,
                 from /home/rpjday/bbx/busybox.new/include/busybox.h:21,
                 from /home/rpjday/bbx/busybox.new/miscutils/hdparm.c:36:
/usr/include/netinet/in.h:354: error: expected declaration specifiers or ‘...’ before ‘(’ token
/usr/include/netinet/in.h:354: error: expected ‘)’ before ‘?’ token
/usr/include/netinet/in.h:355: error: expected declaration specifiers or ‘...’ before ‘(’ token
/usr/include/netinet/in.h:355: error: expected ‘)’ before ‘?’ token
/usr/include/netinet/in.h:357: error: expected declaration specifiers or ‘...’ before ‘(’ token
/usr/include/netinet/in.h:357: error: expected ‘)’ before ‘?’ token
/usr/include/netinet/in.h:359: error: expected declaration specifiers or ‘...’ before ‘(’ token
/usr/include/netinet/in.h:359: error: expected ‘)’ before ‘?’ token
/home/rpjday/bbx/busybox.new/miscutils/hdparm.c: In function ‘hdparm_main’:
/home/rpjday/bbx/busybox.new/miscutils/hdparm.c:2139: warning: implicit declaration of function ‘getopt_long’
make[1]: *** [/home/rpjday/bbx/busybox.new/miscutils/hdparm.o] Error 1
make: *** [busybox] Error 2
...
=================================

  since this started with r15169, and i *really* suspected it has
something to do with type definition of some kind, what i did was to
move the inclusion of "busybox.h" *back* to where it was before in
hdparm.c:

===================================
...
#include <getopt.h>
#include "busybox.h"    <-- original location in r15168
#include <linux/types.h>
...
===================================

  that solved the compilation problem for hdparm.c, but caused
problems later on:

===================================
...
  CC miscutils/hdparm.o
In file included from /home/rpjday/bbx/busybox.new/miscutils/hdparm.c:30:
/usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include <endian.h> instead!
/home/rpjday/bbx/busybox.new/miscutils/hdparm.c: In function ‘hdparm_main’:
/home/rpjday/bbx/busybox.new/miscutils/hdparm.c:2140: warning: implicit declaration of function ‘getopt_long’
  AR cru miscutils/miscutils.a
...
  CC libbb/getopt_ulflags.o
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:302: error: array type has incomplete element type
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c: In function ‘bb_getopt_ulflags’:
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:358: error: dereferencing pointer to incomplete type
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:358: error: increment of pointer to unknown structure
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:358: error: arithmetic on pointer to an incomplete type
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:359: error: dereferencing pointer to incomplete type
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:362: error: dereferencing pointer to incomplete type
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:367: error: dereferencing pointer to incomplete type
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:369: error: dereferencing pointer to incomplete type
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:369: error: ‘no_argument’ undeclared (first use in this function)
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:369: error: (Each undeclared identifier is reported only once
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:369: error: for each function it appears in.)
/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.c:455: warning: implicit declaration of function ‘getopt_long’
make[1]: *** [/home/rpjday/bbx/busybox.new/libbb/getopt_ulflags.o] Error 1
make: *** [busybox] Error 2
...
==================================

so there is *definitely* some weird side-effects related to the change
in getopt and moving the inclusion of "busybox.h".

rday


More information about the busybox mailing list