Greetings,

during update of the busybox port on FreeBSD to 1.19.0, I found these
issues and am attaching patches that I propose for inclusion upstream:

- platform.h: FreeBSD doesn't provide the _unlocked stdio.h garbage.
              Disable.

- match_fstype.c: depends on mntent.h being available (it's not on
                  FreeBSD), compile conditionally

- in kconfig, note that #define _XOPEN_SOURCE 700 prevents the
  definition of SIGWINCH on FreeBSD, as that's a BSD-specific signal.
  I don't know what the best fix is, thus no patch.

- several files lack inclusion of libgen.h, causing complaints like
these for dirname. All files that call dirname must #include <libgen.h>.

coreutils/rmdir.c: In function 'rmdir_main':
coreutils/rmdir.c:72: warning: implicit declaration of function 'dirname'
coreutils/rmdir.c:72: warning: assignment makes pointer from integer
without a cast

  Remains unpatched for now.

- warnings that look like genuine defects (bugs):

miscutils/less.c: In function 'print_found':
miscutils/less.c:726: warning: field precision should have type 'int',
but argument 3 has type 'regoff_t'
miscutils/less.c:726: warning: field precision should have type 'int',
but argument 5 has type 'regoff_t'

libbb/getpty.c: In function 'xgetpty':
libbb/getpty.c:23: warning: ISO C90 forbids mixed declarations and code

libbb/speed_table.c:46: warning: large integer implicitly truncated to
unsigned type
libbb/speed_table.c:49: warning: large integer implicitly truncated to
unsigned type
libbb/speed_table.c:52: warning: large integer implicitly truncated to
unsigned type
libbb/speed_table.c:55: warning: large integer implicitly truncated to
unsigned type

- warnings that look cosmetic:

libbb/udp_io.c: In function 'socket_want_pktinfo':
libbb/udp_io.c:16: warning: unused parameter 'fd'

- note that find.c cannot be compiled with clang:

gmake -f scripts/Makefile.build obj=findutils
  clang -Wp,-MD,findutils/.find.o.d   -std=gnu99 -Iinclude -Ilibbb
-include include/autoconf.h -D_GNU_SOURCE -DNDEBUG -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-D"BB_VER=KBUILD_STR(1.19.0)" -DBB_BT=AUTOCONF_TIMESTAMP -O2 -pipe
-fno-strict-aliasing -Wall -Wshadow -Wwrite-strings -Wundef
-Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function
-Wunused-value -Wmissing-prototypes -Wmissing-declarations
-Wdeclaration-after-statement -Wold-style-definition -fno-builtin-strlen
-finline-limit=0 -fomit-frame-pointer -ffunction-sections
-fdata-sections -fno-guess-branch-probability -funsigned-char
-static-libgcc -falign-functions=1 -falign-jumps=1 -falign-labels=1
-falign-loops=1 -Os     -D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(find)"
-D"KBUILD_MODNAME=KBUILD_STR(find)" -c -o findutils/find.o findutils/find.c
...
findutils/find.c:896:2: error: illegal storage class on function
        auto action* alloc_action(int sizeof_struct, action_fp f);
        ^
findutils/find.c:897:54: error: expected ';' at end of declaration
        action* alloc_action(int sizeof_struct, action_fp f)
                                                            ^
                                                            ;
2 errors generated.
gmake[1]: *** [findutils/find.o] Error 1
gmake: *** [findutils] Error 2
*** Error code 1

Can this be fixed for the next release?

Thank you.
--- ./include/platform.h.orig	2011-08-11 02:23:58.000000000 +0200
+++ ./include/platform.h	2011-08-26 02:10:16.000000000 +0200
@@ -417,6 +417,8 @@
 # undef HAVE_STRVERSCMP
 # undef HAVE_XTABS
 # undef HAVE_DPRINTF
+# undef HAVE_UNLOCKED_STDIO
+# undef HAVE_UNLOCKED_LINE_OPS
 #endif
 
 #if defined(__FreeBSD__)
--- ./libbb/match_fstype.c.orig	2011-08-11 02:23:58.000000000 +0200
+++ ./libbb/match_fstype.c	2011-08-26 02:10:16.000000000 +0200
@@ -10,6 +10,8 @@
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+#ifdef HAVE_MNTENT_H
+
 #include "libbb.h"
 
 int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype)
@@ -40,3 +42,5 @@
 
 	return !match;
 }
+
+#endif /* HAVE_MNTENT_H */
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to