diff --git a/bin/pax/ar_io.c b/bin/pax/ar_io.c index f5ad892be04..a0a2c1dae7d 100644 --- a/bin/pax/ar_io.c +++ b/bin/pax/ar_io.c @@ -63,6 +63,7 @@ __RCSID("$NetBSD: ar_io.c,v 1.56 2015/03/09 23:38:08 sevan Exp $"); #include #include #include +#include #ifdef SUPPORT_RMT #define __RMTLIB_PRIVATE #include diff --git a/bin/pax/extern.h b/bin/pax/extern.h index 298600c2ddb..59012aab8fe 100644 --- a/bin/pax/extern.h +++ b/bin/pax/extern.h @@ -204,7 +204,7 @@ void options(int, char **); OPLIST * opt_next(void); int bad_opt(void); int mkpath(char *); -char *chdname; +//char *chdname; #if !HAVE_NBTOOL_CONFIG_H int do_chroot; #endif diff --git a/bin/pax/options.c b/bin/pax/options.c index 1af5fe4b7c0..5c5109ce377 100644 --- a/bin/pax/options.c +++ b/bin/pax/options.c @@ -214,6 +214,8 @@ int havechd = 0; * parser */ +char *chdname; + void options(int argc, char **argv) { diff --git a/bin/pax/pax.c b/bin/pax/pax.c index 253d5fc94b6..e8f50ea534c 100644 --- a/bin/pax/pax.c +++ b/bin/pax/pax.c @@ -56,6 +56,7 @@ __RCSID("$NetBSD: pax.c,v 1.47 2011/08/29 14:47:48 joerg Exp $"); #include #include #include +#include #include #include #include diff --git a/common/lib/libc/cdb/cdbr.c b/common/lib/libc/cdb/cdbr.c index 9dcdbd0e3ef..5116316d7b3 100644 --- a/common/lib/libc/cdb/cdbr.c +++ b/common/lib/libc/cdb/cdbr.c @@ -86,6 +86,8 @@ __weak_alias(cdbr_open_mem,_cdbr_open_mem) #define fast_remainder32(v,d,m,s1,s2) (v%d) #endif +void mi_vector_hash(const void * __restrict, size_t, uint32_t, uint32_t[3]); + struct cdbr { void (*unmap)(void *, void *, size_t); void *cookie; diff --git a/external/bsd/llvm/dist/llvm/include/llvm/ADT/STLExtras.h b/external/bsd/llvm/dist/llvm/include/llvm/ADT/STLExtras.h index 4e56e4d7447..9697ebad72a 100644 --- a/external/bsd/llvm/dist/llvm/include/llvm/ADT/STLExtras.h +++ b/external/bsd/llvm/dist/llvm/include/llvm/ADT/STLExtras.h @@ -19,6 +19,7 @@ #include "llvm/Support/Compiler.h" #include // for std::size_t +#include // for intptr_t #include // for qsort #include #include diff --git a/external/bsd/llvm/dist/llvm/include/llvm/IR/ValueMap.h b/external/bsd/llvm/dist/llvm/include/llvm/IR/ValueMap.h index f2ea405f142..f9a1a6240e3 100644 --- a/external/bsd/llvm/dist/llvm/include/llvm/IR/ValueMap.h +++ b/external/bsd/llvm/dist/llvm/include/llvm/IR/ValueMap.h @@ -101,7 +101,7 @@ class ValueMap { ~ValueMap() {} - bool hasMD() const { return MDMap; } + bool hasMD() const { return static_cast(MDMap); } MDMapT &MD() { if (!MDMap) MDMap.reset(new MDMapT); diff --git a/lib/libc/cdb/cdbw.c b/lib/libc/cdb/cdbw.c index 379a6d50b42..44775207d88 100644 --- a/lib/libc/cdb/cdbw.c +++ b/lib/libc/cdb/cdbw.c @@ -58,6 +58,8 @@ __weak_alias(cdbw_put_data,_cdbw_put_data) __weak_alias(cdbw_put_key,_cdbw_put_key) #endif +void mi_vector_hash(const void * __restrict, size_t, uint32_t, uint32_t[3]); + struct key_hash { SLIST_ENTRY(key_hash) link; uint32_t hashes[3]; diff --git a/lib/libc/gen/pw_scan.c b/lib/libc/gen/pw_scan.c index 7c162d8c6ab..5fc061c9342 100644 --- a/lib/libc/gen/pw_scan.c +++ b/lib/libc/gen/pw_scan.c @@ -32,6 +32,9 @@ #if HAVE_NBTOOL_CONFIG_H #include "nbtool_config.h" #include "compat_pwd.h" +#if HAVE_ERR_H +#include +#endif #else #include diff --git a/libexec/makewhatis/makewhatis.c b/libexec/makewhatis/makewhatis.c index 9209d408411..84ecd8af9fc 100644 --- a/libexec/makewhatis/makewhatis.c +++ b/libexec/makewhatis/makewhatis.c @@ -47,6 +47,7 @@ __RCSID("$NetBSD: makewhatis.c,v 1.49 2013/06/24 20:57:47 christos Exp $"); #include #include +#include #include #include #include @@ -97,10 +98,10 @@ static void addwhatis(whatis **, char *, char *); static char *makesection(int); static char *makewhatisline(const char *, const char *, const char *); static void catpreprocess(char *); -static char *parsecatpage(const char *, gzFile *); +static char *parsecatpage(const char *, gzFile); static int manpreprocess(char *); -static char *nroff(const char *, gzFile *); -static char *parsemanpage(const char *, gzFile *, int); +static char *nroff(const char *, gzFile); +static char *parsemanpage(const char *, gzFile, int); static char *getwhatisdata(char *); static void processmanpages(manpage **, whatis **); static void dumpwhatis(FILE *, whatis *); @@ -627,7 +628,7 @@ makewhatisline(const char *file, const char *line, const char *section) } static char * -parsecatpage(const char *name, gzFile *in) +parsecatpage(const char *name, gzFile in) { char buffer[8192]; char *section, *ptr, *last; @@ -772,7 +773,7 @@ manpreprocess(char *line) } static char * -nroff(const char *inname, gzFile *in) +nroff(const char *inname, gzFile in) { char tempname[MAXPATHLEN], buffer[65536], *data; int tempfd, bytes, pipefd[2], status; @@ -871,7 +872,7 @@ nroff(const char *inname, gzFile *in) } static char * -parsemanpage(const char *name, gzFile *in, int defaultsection) +parsemanpage(const char *name, gzFile in, int defaultsection) { char *section, buffer[8192], *ptr; static const char POD[] = ".\\\" Automatically generated by Pod"; @@ -1100,7 +1101,7 @@ parsemanpage(const char *name, gzFile *in, int defaultsection) static char * getwhatisdata(char *name) { - gzFile *in; + gzFile in; char *data; int section; diff --git a/sbin/newfs_udf/newfs_udf.h b/sbin/newfs_udf/newfs_udf.h index 1c21a0b48e4..e9ff149a5b3 100644 --- a/sbin/newfs_udf/newfs_udf.h +++ b/sbin/newfs_udf/newfs_udf.h @@ -53,8 +53,8 @@ extern float meta_fract; /* shared structure between udf_create.c users */ -struct udf_create_context context; -struct udf_disclayout layout; +extern struct udf_create_context context; +extern struct udf_disclayout layout; /* prototypes */ int udf_write_sector(void *sector, uint64_t location); diff --git a/sbin/newfs_udf/udf_create.c b/sbin/newfs_udf/udf_create.c index ef92874af60..6d95a2bf82c 100644 --- a/sbin/newfs_udf/udf_create.c +++ b/sbin/newfs_udf/udf_create.c @@ -52,6 +52,10 @@ __RCSID("$NetBSD: udf_create.c,v 1.25 2015/06/16 23:18:55 christos Exp $"); # endif #endif +/* shared structure between udf_create.c users */ +struct udf_create_context context; +struct udf_disclayout layout; + /* * NOTE that there is some overlap between this code and the udf kernel fs. * This is intentially though it might better be factored out one day. diff --git a/tools/compat/compat_defs.h b/tools/compat/compat_defs.h index e6ea51ebc38..15f28c36c28 100644 --- a/tools/compat/compat_defs.h +++ b/tools/compat/compat_defs.h @@ -28,6 +28,7 @@ #undef _POSIX_SOURCE #undef _POSIX_C_SOURCE #define __USE_ISOC99 1 +#define _XOPEN_SOURCE 600 #endif /* __linux__ && HAVE_FEATURES_H */ /* System headers needed for (re)definitions below. */ @@ -321,6 +322,10 @@ int dprintf(int, const char *, ...); int flock(int, int); #endif +#if !HAVE_FPURGE +int fpurge(FILE *); +#endif + #if !HAVE_FPARSELN || BROKEN_FPARSELN || defined(__NetBSD__) || defined(__minix) # define FPARSELN_UNESCESC 0x01 # define FPARSELN_UNESCCONT 0x02 @@ -559,6 +564,18 @@ int vasnprintf(char **, size_t, const char *, va_list); int vsnprintf(char *, size_t, const char *, va_list); #endif +/* Wide character function declarations */ +#if defined(__linux__) +#include +#ifndef wcwidth +int wcwidth(wchar_t); +#endif +#endif + +/* NetBSD-specific hash function */ +void mi_vector_hash(const void * __restrict, size_t, uint32_t, + uint32_t[3]); + /* * getmode() and setmode() are always defined, as these function names * exist but with very different meanings on other OS's. The compat diff --git a/tools/compat/fpurge.c b/tools/compat/fpurge.c index 0c859ce7388..4cbd0bc3dee 100644 --- a/tools/compat/fpurge.c +++ b/tools/compat/fpurge.c @@ -38,12 +38,18 @@ #if !HAVE_FPURGE #include #include +#if HAVE___FPURGE +#include +#endif -void +int fpurge(FILE *fp) { #if HAVE___FPURGE __fpurge(fp); + return 0; +#else + return 0; #endif } #endif diff --git a/tools/texinfo/Makefile b/tools/texinfo/Makefile index 821e6d6ac83..22def2c4a38 100644 --- a/tools/texinfo/Makefile +++ b/tools/texinfo/Makefile @@ -4,6 +4,9 @@ MODULE= texinfo CONFIGURE_ARGS= --program-prefix=${_TOOL_PREFIX} +# Disable incompatible-pointer-types warning for old K&R style code +HOST_CFLAGS+= -Wno-incompatible-pointer-types + .include "${.CURDIR}/../Makefile.gnuhost" .if !empty(.MAKE.OS:M*CYGWIN*) && target(install) diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 73f4aaa9c69..72a71f72233 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -192,6 +192,8 @@ char *makeDependfile; pid_t myPid; int makelevel; +FILE *debug_file; + Boolean forceJobs = FALSE; extern Lst parseIncPath; diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index f162ef67030..e07bba3cc57 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -440,7 +440,7 @@ extern pid_t myPid; * There is one bit per module. It is up to the module what debug * information to print. */ -FILE *debug_file; /* Output written here - default stdout */ +extern FILE *debug_file; /* Output written here - default stdout */ extern int debug; #define DEBUG_ARCH 0x00001 #define DEBUG_COND 0x00002 diff --git a/usr.bin/tic/tic.c b/usr.bin/tic/tic.c index a6b72db56be..8a405108414 100644 --- a/usr.bin/tic/tic.c +++ b/usr.bin/tic/tic.c @@ -53,6 +53,7 @@ __RCSID("$NetBSD: tic.c,v 1.24 2014/07/20 20:20:16 christos Exp $"); #include #include #include +#include #include #include #include diff --git a/usr.sbin/installboot/machines.c b/usr.sbin/installboot/machines.c index 357652b83b7..2340d3b5137 100644 --- a/usr.sbin/installboot/machines.c +++ b/usr.sbin/installboot/machines.c @@ -48,13 +48,13 @@ __RCSID("$NetBSD: machines.c,v 1.39 2014/02/24 07:23:44 skrll Exp $"); */ struct ib_mach ib_mach_alpha, - ib_mach_amd64, +// ib_mach_amd64, ib_mach_amiga, ib_mach_emips, ib_mach_ews4800mips, ib_mach_hp300, ib_mach_hppa, - ib_mach_i386, + // ib_mach_i386, ib_mach_landisk, ib_mach_macppc, ib_mach_news68k,