was error in latest build, svn 15200: Enable getopt long

Tito farmatito at tiscali.it
Sat May 27 05:28:30 PDT 2006


On Saturday 27 May 2006 13:28, Robert P. J. Day wrote:
> 
>   i haven't even had time to look more closely at this, but this is
> from a "make defconfig busybox" of the latest checkout:
> 
>   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!
> 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:37:
> /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
> make[1]: *** [/home/rpjday/bbx/busybox.new/miscutils/hdparm.o] Error 1
> make: *** [busybox] Error 2
> 
> 
> rday

Hi,
can't see this. 

The only breakage I can see is in hdparm when i disable "Enable getopt long (system needs struct option for this to work)" 

/root/Desktop/busybox/miscutils/hdparm.c: In function ‘hdparm_main’:
/root/Desktop/busybox/miscutils/hdparm.c:2140: warning: implicit declaration of function ‘getopt_long’

Probably we need 

#define _GNU_SOURCE

in hdparm now.

BTW: this idea to disable long options seems a little dangerous to me as:

1) there are applets that uses getopt_long themselves (at least hdparm, possibly others...)
2) there are options that are available only as long options (ls --color, hdparm --Istdin, probably others)

So maybe rather then disable getopt_long totally if the problem is portability
wouldn't it be better to ship a private copy of getopt_long in libbb?


Ciao,
Tito






More information about the busybox mailing list