diff --git a/bin/sh/arith_lex.l b/bin/sh/arith_lex.l
index e57fb7c..3eeddad 100644
--- a/bin/sh/arith_lex.l
+++ b/bin/sh/arith_lex.l
@@ -54,6 +54,7 @@ int yylex(void);
 #undef YY_INPUT
 #define YY_INPUT(buf,result,max) \
 	result = (*buf = *arith_buf++) ? 1 : YY_NULL;
+#define YY_NO_INPUT
 #define YY_NO_UNPUT
 %}
 
diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c
index 1c1e988..64566bd 100644
--- a/bin/sh/histedit.c
+++ b/bin/sh/histedit.c
@@ -191,7 +191,7 @@ histcmd(int argc, char **argv)
 	char *pat = NULL, *repl = NULL;
 	static int active = 0;
 	struct jmploc jmploc;
-	struct jmploc *volatile savehandler;
+	struct jmploc *volatile savehandler = NULL;
 	char editfile[PATH_MAX];
 	FILE *efp = NULL;
 	int oldhistnum;
diff --git a/contrib/libpcap/scanner.l b/contrib/libpcap/scanner.l
index c477684..f2d0d80 100644
--- a/contrib/libpcap/scanner.l
+++ b/contrib/libpcap/scanner.l
@@ -64,6 +64,7 @@ static inline int xdtoi(int);
 
 #ifdef FLEX_SCANNER
 #define YY_NO_UNPUT
+#define YY_NO_INPUT
 static YY_BUFFER_STATE in_buffer;
 #else
 static char *in_buffer;
diff --git a/contrib/tcsh-6/config_f.h b/contrib/tcsh-6/config_f.h
index aee7363..ecb3dda 100644
--- a/contrib/tcsh-6/config_f.h
+++ b/contrib/tcsh-6/config_f.h
@@ -189,7 +189,7 @@
 # ifndef __GNUC__
 #  define RCSID(id) static char *rcsid = (id);
 # else
-#  define RCSID(id) static char *rcsid(const char *a) { return rcsid(a = id); }
+#  define RCSID(id) static const char rcsid[] __attribute__((__used__)) = (id);
 # endif /* !__GNUC__ */
 #else
 # define RCSID(id)	/* Nothing */
diff --git a/games/atc/lex.l b/games/atc/lex.l
index 6474801..5eeb782 100644
--- a/games/atc/lex.l
+++ b/games/atc/lex.l
@@ -50,6 +50,7 @@
 #include	<unistd.h>
 #include	"y.tab.h"
 
+#define		YY_NO_INPUT
 #define		YY_NO_UNPUT
 extern int	line;
 extern int	yylex(void);
diff --git a/games/hunt/huntd/makemaze.c b/games/hunt/huntd/makemaze.c
index 06ef40a..d85b172 100644
--- a/games/hunt/huntd/makemaze.c
+++ b/games/hunt/huntd/makemaze.c
@@ -42,8 +42,6 @@
 # define	ISCLEAR(y,x)	(Maze[y][x] == SPACE)
 # define	ODD(n)		((n) & 01)
 
-static	int	candig(int, int);
-static	void	dig(int, int);
 static	void	dig_maze(int, int);
 static	void	remap(void);
 
@@ -83,60 +81,6 @@ int	incr[NDIR][2] = {
 	};
 
 static void
-dig(int y, int x)
-{
-	int	*dp;
-	int	*ip;
-	int	ny, nx;
-	int	*endp;
-
-	Maze[y][x] = SPACE;			/* Clear this spot */
-	dp = dirs[rand_num(NPERM)];
-	endp = &dp[NDIR];
-	while (dp < endp) {
-		ip = &incr[*dp++][0];
-		ny = y + *ip++;
-		nx = x + *ip;
-		if (candig(ny, nx))
-			dig(ny, nx);
-	}
-}
-
-/*
- * candig:
- *	Is it legal to clear this spot?
- */
-static int
-candig(int y, int x)
-{
-	int	i;
-
-	if (ODD(x) && ODD(y))
-		return FALSE;		/* can't touch ODD spots */
-
-	if (y < UBOUND || y >= DBOUND)
-		return FALSE;		/* Beyond vertical bounds, NO */
-	if (x < LBOUND || x >= RBOUND)
-		return FALSE;		/* Beyond horizontal bounds, NO */
-
-	if (ISCLEAR(y, x))
-		return FALSE;		/* Already clear, NO */
-
-	i = ISCLEAR(y, x + 1);
-	i += ISCLEAR(y, x - 1);
-	if (i > 1)
-		return FALSE;		/* Introduces cycle, NO */
-	i += ISCLEAR(y + 1, x);
-	if (i > 1)
-		return FALSE;		/* Introduces cycle, NO */
-	i += ISCLEAR(y - 1, x);
-	if (i > 1)
-		return FALSE;		/* Introduces cycle, NO */
-
-	return TRUE;			/* OK */
-}
-
-static void
 dig_maze(int x, int y)
 {
 	int	tx, ty;
diff --git a/lib/libipsec/policy_token.l b/lib/libipsec/policy_token.l
index 1043448..f51607d 100644
--- a/lib/libipsec/policy_token.l
+++ b/lib/libipsec/policy_token.l
@@ -47,6 +47,8 @@
 #include <unistd.h>
 #include <errno.h>
 
+#define YY_NO_INPUT
+
 #ifndef __NetBSD__
 #include "y.tab.h"
 #else
diff --git a/libexec/dma/aliases_scan.l b/libexec/dma/aliases_scan.l
index b68e092..5e6bdd5 100644
--- a/libexec/dma/aliases_scan.l
+++ b/libexec/dma/aliases_scan.l
@@ -3,6 +3,8 @@
 #include <string.h>
 #include "aliases_parse.h"
 
+#define YY_NO_INPUT
+
 int yylex(void);
 %}
 
diff --git a/sbin/routed/if.c b/sbin/routed/if.c
index 462623b..8fbc2f3 100644
--- a/sbin/routed/if.c
+++ b/sbin/routed/if.c
@@ -43,7 +43,6 @@ static char sccsid[] __attribute__((unused)) = "@(#)if.c	8.1 (Berkeley) 6/5/93";
 #include <sys/cdefs.h>
 __RCSID("$NetBSD$");
 #endif
-#ident "$FreeBSD: src/sbin/routed/if.c,v 1.6.2.1 2000/08/14 17:00:03 sheldonh Exp $"
 
 struct interface *ifnet;		/* all interfaces */
 
diff --git a/sbin/routed/input.c b/sbin/routed/input.c
index ebbf97e..43a3ddd 100644
--- a/sbin/routed/input.c
+++ b/sbin/routed/input.c
@@ -42,7 +42,6 @@ static char sccsid[] __attribute__((unused)) = "@(#)input.c	8.1 (Berkeley) 6/5/9
 #include <sys/cdefs.h>
 __RCSID("$NetBSD$");
 #endif
-#ident "$FreeBSD: src/sbin/routed/input.c,v 1.7.2.1 2001/08/01 09:01:45 obrien Exp $"
 
 static void input(struct sockaddr_in *, struct interface *, struct interface *,
 		  struct rip *, int);
diff --git a/sbin/routed/main.c b/sbin/routed/main.c
index 825133b..3560950 100644
--- a/sbin/routed/main.c
+++ b/sbin/routed/main.c
@@ -53,7 +53,6 @@ __RCSID("$NetBSD$");
 __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\n\
 	The Regents of the University of California.  All rights reserved.\n");
 #endif
-#ident "$FreeBSD: src/sbin/routed/main.c,v 1.11.2.1 2000/08/14 17:00:03 sheldonh Exp $"
 
 
 pid_t	mypid;
diff --git a/sbin/routed/output.c b/sbin/routed/output.c
index 43cc184..efb8ea9 100644
--- a/sbin/routed/output.c
+++ b/sbin/routed/output.c
@@ -41,7 +41,6 @@ static char sccsid[] __attribute__((unused)) = "@(#)output.c	8.1 (Berkeley) 6/5/
 #elif defined(__NetBSD__)
 __RCSID("$NetBSD$");
 #endif
-#ident "$FreeBSD: src/sbin/routed/output.c,v 1.5.2.1 2000/08/14 17:00:03 sheldonh Exp $"
 
 
 u_int update_seqno;
diff --git a/sbin/routed/parms.c b/sbin/routed/parms.c
index 6b05a95..054bb5c 100644
--- a/sbin/routed/parms.c
+++ b/sbin/routed/parms.c
@@ -43,7 +43,6 @@ static char sccsid[] __attribute__((unused)) = "@(#)if.c	8.1 (Berkeley) 6/5/93";
 #elif defined(__NetBSD__)
 __RCSID("$NetBSD$");
 #endif
-#ident "$FreeBSD: src/sbin/routed/parms.c,v 1.7.2.1 2000/08/14 17:00:03 sheldonh Exp $"
 
 
 struct parm *parms;
diff --git a/sbin/routed/radix.c b/sbin/routed/radix.c
index f823c61..8f781f5 100644
--- a/sbin/routed/radix.c
+++ b/sbin/routed/radix.c
@@ -47,7 +47,6 @@ static char sccsid[] __attribute__((unused)) = "@(#)rdisc.c	8.1 (Berkeley) x/y/9
 #elif defined(__NetBSD__)
 __RCSID("$NetBSD$");
 #endif
-#ident "$FreeBSD: src/sbin/routed/radix.c,v 1.5 1999/09/05 17:49:11 peter Exp $"
 
 #define log(x, msg) syslog(x, msg)
 #define panic(s) {log(LOG_ERR,s); exit(1);}
diff --git a/sbin/routed/rdisc.c b/sbin/routed/rdisc.c
index c9209be..0e15d4a 100644
--- a/sbin/routed/rdisc.c
+++ b/sbin/routed/rdisc.c
@@ -44,7 +44,6 @@ static char sccsid[] __attribute__((unused)) = "@(#)rdisc.c	8.1 (Berkeley) x/y/9
 #elif defined(__NetBSD__)
 __RCSID("$NetBSD$");
 #endif
-#ident "$FreeBSD: src/sbin/routed/rdisc.c,v 1.5.2.1 2000/08/14 17:00:04 sheldonh Exp $"
 
 /* router advertisement ICMP packet */
 struct icmp_ad {
diff --git a/sbin/routed/rtquery/rtquery.c b/sbin/routed/rtquery/rtquery.c
index e12c20a..d3743a3 100644
--- a/sbin/routed/rtquery/rtquery.c
+++ b/sbin/routed/rtquery/rtquery.c
@@ -63,7 +63,6 @@ static char sccsid[] __attribute__((unused))= "@(#)query.c	8.1 (Berkeley) 6/5/93
 #elif defined(__NetBSD__)
 __RCSID("$NetBSD: rtquery.c,v 1.10 1999/02/23 10:47:41 christos Exp $");
 #endif
-#ident "$Revision: 1.12 $"
 
 #ifndef sgi
 #define _HAVE_SIN_LEN
diff --git a/sbin/routed/table.c b/sbin/routed/table.c
index f74110a..b6b175c 100644
--- a/sbin/routed/table.c
+++ b/sbin/routed/table.c
@@ -41,7 +41,6 @@ static char sccsid[] __attribute__((unused)) = "@(#)tables.c	8.1 (Berkeley) 6/5/
 #elif defined(__NetBSD__)
 __RCSID("$NetBSD$");
 #endif
-#ident "$FreeBSD: src/sbin/routed/table.c,v 1.9.2.2 2000/08/14 17:00:04 sheldonh Exp $"
 
 static struct rt_spare *rts_better(struct rt_entry *);
 static struct rt_spare rts_empty = {0,0,0,HOPCNT_INFINITY,0,0,0};
diff --git a/sbin/routed/trace.c b/sbin/routed/trace.c
index 4db48e7..35eafe5 100644
--- a/sbin/routed/trace.c
+++ b/sbin/routed/trace.c
@@ -46,7 +46,6 @@ static char sccsid[] __attribute__((unused)) = "@(#)trace.c	8.1 (Berkeley) 6/5/9
 #elif defined(__NetBSD__)
 __RCSID("$NetBSD$");
 #endif
-#ident "$FreeBSD: src/sbin/routed/trace.c,v 1.5.2.1 2002/11/07 17:19:13 imp Exp $"
 
 
 #ifdef sgi
diff --git a/sys/boot/pc32/boot2/Makefile b/sys/boot/pc32/boot2/Makefile
index 92006e1..4160f62 100644
--- a/sys/boot/pc32/boot2/Makefile
+++ b/sys/boot/pc32/boot2/Makefile
@@ -53,6 +53,7 @@ CFLAGS=	-elf -ffreestanding -Os -fno-builtin \
 	-Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
 	-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
 	-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings
+DEBUG_FLAGS=
 
 # Tell gcc that it shouldn't do fancy optimizations for newer processors.
 # Otherwise it winds up creating larger code and we won't be able to fit boot2.
diff --git a/sys/cpu/i386/include/float.h b/sys/cpu/i386/include/float.h
index cd59a14..cb9f3e1 100644
--- a/sys/cpu/i386/include/float.h
+++ b/sys/cpu/i386/include/float.h
@@ -40,42 +40,158 @@ __BEGIN_DECLS
 extern int	__flt_rounds(void);
 __END_DECLS
 
+#ifdef __FLT_RADIX__
+#define FLT_RADIX	__FLT_RADIX__
+#else
 #define FLT_RADIX	2		/* b */
+#endif
 #define	FLT_ROUNDS	__flt_rounds()
 #if __ISO_C_VISIBLE >= 1999
+#ifdef __FLT_EVAL_METHOD__
+#define FLT_EVAL_METHOD	__FLT_EVAL_METHOD__
+#else
 #define FLT_EVAL_METHOD	(-1)		/* i387 semantics are...interesting */
+#endif
 #define DECIMAL_DIG	21		/* max precision in decimal digits */
 #endif
 
+#ifdef __FLT_MANT_DIG__
+#define FLT_MANT_DIG	__FLT_MANT_DIG__
+#else
 #define FLT_MANT_DIG	24		/* p */
+#endif
+#ifdef __FLT_EPSILON__
+#define FLT_EPSILON	__FLT_EPSILON__
+#else
 #define FLT_EPSILON	1.19209290E-07F	/* b**(1-p) */
+#endif
+#ifdef __FLT_DIG__
+#define FLT_DIG		__FLT_DIG__
+#else
 #define FLT_DIG		6		/* floor((p-1)*log10(b))+(b == 10) */
+#endif
+#ifdef __FLT_MIN_EXP__
+#define FLT_MIN_EXP	__FLT_MIN_EXP__
+#else
 #define FLT_MIN_EXP	(-125)		/* emin */
+#endif
+#ifdef __FLT_MIN__
+#define FLT_MIN		__FLT_MIN__
+#else
 #define FLT_MIN		1.17549435E-38F	/* b**(emin-1) */
+#endif
+#ifdef __FLT_MIN_10_EXP__
+#define FLT_MIN_10_EXP	__FLT_MIN_10_EXP__
+#else
 #define FLT_MIN_10_EXP	(-37)		/* ceil(log10(b**(emin-1))) */
+#endif
+#ifdef __FLT_MAX_EXP__
+#define FLT_MAX_EXP	__FLT_MAX_EXP__
+#else
 #define FLT_MAX_EXP	128		/* emax */
+#endif
+#ifdef __FLT_MAX__
+#define FLT_MAX		__FLT_MAX__
+#else
 #define FLT_MAX		3.40282347E+38F	/* (1-b**(-p))*b**emax */
+#endif
+#ifdef __FLT_MAX_10_EXP__
+#define FLT_MAX_10_EXP	__FLT_MAX_10_EXP__
+#else
 #define FLT_MAX_10_EXP	38		/* floor(log10((1-b**(-p))*b**emax)) */
+#endif
 
+#ifdef __DBL_MANT_DIG__
+#define DBL_MANT_DIG	__DBL_MANT_DIG__
+#else
 #define DBL_MANT_DIG	53
+#endif
+#ifdef __DBL_EPSILON__
+#define DBL_EPSILON	__DBL_EPSILON__
+#else
 #define DBL_EPSILON	2.2204460492503131E-16
+#endif
+#ifdef __DBL_DIG__
+#define DBL_DIG		__DBL_DIG__
+#else
 #define DBL_DIG		15
+#endif
+#ifdef __DBL_MIN_EXP__
+#define DBL_MIN_EXP	__DBL_MIN_EXP__
+#else
 #define DBL_MIN_EXP	(-1021)
+#endif
+#ifdef __DBL_MIN__
+#define DBL_MIN		__DBL_MIN__
+#else
 #define DBL_MIN		2.2250738585072014E-308
+#endif
+#ifdef __DBL_MIN_10_EXP__
+#define DBL_MIN_10_EXP	__DBL_MIN_10_EXP__
+#else
 #define DBL_MIN_10_EXP	(-307)
+#endif
+#ifdef __DBL_MAX_EXP__
+#define DBL_MAX_EXP	__DBL_MAX_EXP__
+#else
 #define DBL_MAX_EXP	1024
+#endif
+#ifdef __DBL_MAX__
+#define DBL_MAX		__DBL_MAX__
+#else
 #define DBL_MAX		1.7976931348623157E+308
+#endif
+#ifdef __DBL_MAX_10_EXP__
+#define DBL_MAX_10_EXP	__DBL_MAX_10_EXP__
+#else
 #define DBL_MAX_10_EXP	308
+#endif
 
+#ifdef __LDBL_MANT_DIG__
+#define	LDBL_MANT_DIG	__LDBL_MANT_DIG__
+#else
 #define	LDBL_MANT_DIG	64
+#endif
+#ifdef __LDBL_EPSILON__
+#define	LDBL_EPSILON	__LDBL_EPSILON__
+#else
 #define	LDBL_EPSILON	1.0842021724855044340E-19L
+#endif
+#ifdef __LDBL_DIG__
+#define	LDBL_DIG	__LDBL_DIG__
+#else
 #define	LDBL_DIG	18
+#endif
+#ifdef __LDBL_MIN_EXP__
+#define	LDBL_MIN_EXP	__LDBL_MIN_EXP__
+#else
 #define	LDBL_MIN_EXP	(-16381)
+#endif
+#ifdef __LDBL_MIN__
+#define	LDBL_MIN	__LDBL_MIN__
+#else
 #define	LDBL_MIN	3.3621031431120935063E-4932L
+#endif
+#ifdef __LDBL_MIN_10_EXP__
+#define	LDBL_MIN_10_EXP	__LDBL_MIN_10_EXP__
+#else
 #define	LDBL_MIN_10_EXP	(-4931)
+#endif
+#ifdef __LDBL_MAX_EXP__
+#define	LDBL_MAX_EXP	__LDBL_MAX_EXP__
+#else
 #define	LDBL_MAX_EXP	16384
+#endif
+#ifdef __LDBL_MAX__
+#define	LDBL_MAX	__LDBL_MAX__
+#else
 #define	LDBL_MAX	1.1897314953572317650E+4932L
+#endif
+#ifdef __LDBL_MAX_10_EXP__
+#define	LDBL_MAX_10_EXP	__LDBL_MAX_10_EXP__
+#else
 #define	LDBL_MAX_10_EXP	4932
+#endif
 
 #define	__GDTOA_IEEE_8087	1
 #define	__GDTOA_F_QNAN		0xffc00000
diff --git a/usr.bin/bc/scan.l b/usr.bin/bc/scan.l
index 52e585d..5bc1a17 100644
--- a/usr.bin/bc/scan.l
+++ b/usr.bin/bc/scan.l
@@ -31,6 +31,8 @@
 #include "pathnames.h"
 #include "y.tab.h"
 
+#define YY_NO_INPUT
+
 int		lineno;
 bool		interactive;
 
diff --git a/usr.bin/colldef/scan.l b/usr.bin/colldef/scan.l
index 64b2256..a12e56b 100644
--- a/usr.bin/colldef/scan.l
+++ b/usr.bin/colldef/scan.l
@@ -39,6 +39,8 @@
 #include "common.h"
 #include "y.tab.h"
 
+#define YY_NO_INPUT
+
 int line_no = 1, save_no, fromsubs;
 static u_char buffer[BUFSIZE], *buf_ptr;
 FILE *map_fp;
diff --git a/usr.bin/doscmd/int14.c b/usr.bin/doscmd/int14.c
index bed7cc3..2db9d5b 100644
--- a/usr.bin/doscmd/int14.c
+++ b/usr.bin/doscmd/int14.c
@@ -438,7 +438,7 @@ com_set_line(struct com_data_struct *cdsp, unsigned char port, unsigned char par
 	"com_set_line: going with cflag 0x%X iflag 0x%X speed %d.\n",
 	cdsp->tty.c_cflag, cdsp->tty.c_iflag, speed);
     div_lo = (115200 / spd) & 0x00ff;
-    div_hi = (115200 / spd) & 0xff00;
+    div_hi = ((115200 / spd) & 0xff00) >> 8;
     cdsp->div_latch[DIV_LATCH_LOW] = div_lo;
     cdsp->div_latch[DIV_LATCH_HIGH] = div_hi;
     errno = 0;
diff --git a/usr.bin/ee/ee.c b/usr.bin/ee/ee.c
index 0bf023e..45ea423 100644
--- a/usr.bin/ee/ee.c
+++ b/usr.bin/ee/ee.c
@@ -554,7 +554,7 @@ main(int argc, char **argv)		/* beginning of main program		*/
 
 	d_char = malloc(3);	/* provide a buffer for multi-byte chars */
 	d_word = malloc(150);
-	*d_word = (char) NULL;
+	*d_word = 0;
 	d_line = NULL;
 	dlt_line = txtalloc();
 	dlt_line->line = d_line;
@@ -792,7 +792,7 @@ delete(int disp)			/* delete character		*/
 				d_char[0] = *point;
 				d_char[1] = *(point + 1);
 			}
-			d_char[del_width] = (unsigned char) NULL;
+			d_char[del_width] = 0;
 		}
 		while (temp_pos <= curr_line->line_length)
 		{
@@ -821,7 +821,7 @@ delete(int disp)			/* delete character		*/
 		if (in == 8)
 		{
 			d_char[0] = '\n';
-			d_char[1] = (unsigned char) NULL;
+			d_char[1] = 0;
 		}
 		tp = point;
 		temp_pos = 1;
@@ -833,7 +833,7 @@ delete(int disp)			/* delete character		*/
 			tp++;
 			temp2++;
 		}
-		*tp = (char) NULL;
+		*tp = 0;
 		free(temp_buff->line);
 		free(temp_buff);
 		temp_buff = curr_line;
@@ -955,7 +955,7 @@ out_char(WINDOW *window, int character, int column)
 		waddch(window, (unsigned char)character);
 		return(1);
 	}
-	for (i2 = 0; (string[i2] != (char) NULL) && (((column+i2+1)-horiz_offset) < last_col); i2++)
+	for (i2 = 0; (string[i2] != 0) && (((column+i2+1)-horiz_offset) < last_col); i2++)
 		waddch(window, string[i2]);
 	return(strlen(string));
 }
@@ -1081,13 +1081,13 @@ insert_line(int disp)			/* insert new line		*/
 			temp++;
 		}
 		temp=point;
-		*temp = (char) NULL;
+		*temp = 0;
 		temp = resiz_line((1 - temp_nod->line_length), curr_line, position);
 		curr_line->line_length = 1 + temp - curr_line->line;
 	}
 	curr_line->line_length = position;
 	curr_line = temp_nod;
-	*extra = (char) NULL;
+	*extra = 0;
 	position = 1;
 	point= curr_line->line;
 	if (disp)
@@ -1130,9 +1130,9 @@ struct files *name_alloc(void)	/* allocate space for file name list node */
 unsigned char *next_word(unsigned char *string)
 /* move to next word in string */
 {
-	while ((*string != (char) NULL) && ((*string != 32) && (*string != 9)))
+	while ((*string != 0) && ((*string != 32) && (*string != 9)))
 		string++;
-	while ((*string != (char) NULL) && ((*string == 32) || (*string == 9)))
+	while ((*string != 0) && ((*string == 32) || (*string == 9)))
 		string++;
 	return(string);
 }
@@ -1166,7 +1166,7 @@ control(void)			/* use control for commands		*/
 	if (in == 1)		/* control a	*/
 	{
 		string = get_string(ascii_code_str, TRUE);
-		if (*string != (char) NULL)
+		if (*string != 0)
 		{
 			in = atoi(string);
 			wmove(text_win, scr_vert, (scr_horz - horiz_offset));
@@ -1274,7 +1274,7 @@ emacs_control(void)
 	else if (in == 15)	/* control o	*/
 	{
 		string = get_string(ascii_code_str, TRUE);
-		if (*string != (char) NULL)
+		if (*string != 0)
 		{
 			in = atoi(string);
 			wmove(text_win, scr_vert, (scr_horz - horiz_offset));
@@ -1672,7 +1672,7 @@ command(char *cmd_str1)		/* process commands from keyboard	*/
 			return;
 		}
 		cmd_str = next_word(cmd_str);
-		if (*cmd_str == (char) NULL)
+		if (*cmd_str == 0)
 		{
 			cmd_str = cmd_str2 = get_string(file_write_prompt_str, TRUE);
 		}
@@ -1688,7 +1688,7 @@ command(char *cmd_str1)		/* process commands from keyboard	*/
 			return;
 		}
 		cmd_str = next_word(cmd_str);
-		if (*cmd_str == (char) NULL)
+		if (*cmd_str == 0)
 		{
 			cmd_str = cmd_str2 = get_string(file_read_prompt_str, TRUE);
 		}
@@ -1900,9 +1900,9 @@ get_string(char *prompt, int advance)
 		}
 		wrefresh(com_win);
 		if (esc_flag)
-			in = (char) NULL;
+			in = 0;
 	} while ((in != '\n') && (in != '\r'));
-	*nam_str = (char) NULL;
+	*nam_str = 0;
 	nam_str = tmp_string;
 	if (((*nam_str == ' ') || (*nam_str == 9)) && (advance))
 		nam_str = next_word(nam_str);
@@ -1924,7 +1924,7 @@ compare(char *string1, char *string2, int sensitive) /* compare two strings */
 	strng1 = string1;
 	strng2 = string2;
 	tmp = 0;
-	if ((strng1 == NULL) || (strng2 == NULL) || (*strng1 == (char) NULL) || (*strng2 == (char) NULL))
+	if ((strng1 == NULL) || (strng2 == NULL) || (*strng1 == 0) || (*strng2 == 0))
 		return(FALSE);
 	equal = TRUE;
 	while (equal)
@@ -1941,7 +1941,7 @@ compare(char *string1, char *string2, int sensitive) /* compare two strings */
 		}
 		strng1++;
 		strng2++;
-		if ((*strng1 == (char) NULL) || (*strng2 == (char) NULL) || (*strng1 == ' ') || (*strng2 == ' '))
+		if ((*strng1 == 0) || (*strng2 == 0) || (*strng1 == ' ') || (*strng2 == ' '))
 			break;
 		tmp++;
 	}
@@ -2084,13 +2084,13 @@ get_options(int numargs, char **arguments)
 				temp_names = temp_names->next_name;
 			}
 			ptr = temp_names->name = malloc(strlen(buff) + 1);
-			while (*buff != (char) NULL)
+			while (*buff != 0)
 			{
 				*ptr = *buff;
 				buff++;
 				ptr++;
 			}
-			*ptr = (char) NULL;
+			*ptr = 0;
 			temp_names->next_name = NULL;
 			input_file = TRUE;
 			recv_file = TRUE;
@@ -2173,7 +2173,7 @@ check_fp(void)		/* open or close files according to flags */
 		wmove(com_win, 0, 0);
 		wclrtoeol(com_win);
 		text_changes = TRUE;
-		if ((tmp_file != NULL) && (*tmp_file != (char) NULL))
+		if ((tmp_file != NULL) && (*tmp_file != 0))
 			wprintw(com_win, file_read_fin_msg, tmp_file);
 	}
 	wrefresh(com_win);
@@ -2314,7 +2314,7 @@ get_line(int length, unsigned char *in_string, int *append)
 			point++;
 			str1++;
 		}
-		*point = (char) NULL;
+		*point = 0;
 		*append = FALSE;
 		if ((num == length) && (*str2 != '\n'))
 			*append = TRUE;
@@ -2352,10 +2352,10 @@ finish(void)	/* prepare to exit edit session	*/
 	 |	portion of file_op()
 	 */
 
-	if ((file_name == NULL) || (*file_name == (char) NULL))
+	if ((file_name == NULL) || (*file_name == 0))
 		file_name = get_string(save_file_name_prompt, TRUE);
 
-	if ((file_name == NULL) || (*file_name == (char) NULL))
+	if ((file_name == NULL) || (*file_name == 0))
 	{
 		wmove(com_win, 0, 0);
 		wprintw(com_win, file_not_saved_msg);
@@ -2438,7 +2438,7 @@ delete_text(void)
 		free(curr_line->next_line);
 	}
 	curr_line->next_line = NULL;
-	*curr_line->line = (char) NULL;
+	*curr_line->line = 0;
 	curr_line->line_length = 1;
 	curr_line->line_number = 1;
 	point = curr_line->line;
@@ -2527,7 +2527,7 @@ search(int display_message) /* search for string in srch_str */
 	int iter;
 	int found;
 
-	if ((srch_str == NULL) || (*srch_str == (char) NULL))
+	if ((srch_str == NULL) || (*srch_str == 0))
 		return(FALSE);
 	if (display_message)
 	{
@@ -2552,7 +2552,7 @@ search(int display_message) /* search for string in srch_str */
 			if (case_sen)	/* if case sensitive		*/
 			{
 				srch_3 = srch_str;
-			while ((*srch_2 == *srch_3) && (*srch_3 != (char) NULL))
+			while ((*srch_2 == *srch_3) && (*srch_3 != 0))
 				{
 					found = TRUE;
 					srch_2++;
@@ -2562,14 +2562,14 @@ search(int display_message) /* search for string in srch_str */
 			else		/* if not case sensitive	*/
 			{
 				srch_3 = u_srch_str;
-			while ((toupper(*srch_2) == *srch_3) && (*srch_3 != (char) NULL))
+			while ((toupper(*srch_2) == *srch_3) && (*srch_3 != 0))
 				{
 					found = TRUE;
 					srch_2++;
 					srch_3++;
 				}
 			}	/* end else	*/
-			if (!((*srch_3 == (char) NULL) && (found)))
+			if (!((*srch_3 == 0) && (found)))
 			{
 				found = FALSE;
 				if (iter < srch_line->line_length)
@@ -2637,19 +2637,19 @@ search_prompt(void) /* prompt and read search string (srch_str) */
 {
 	if (srch_str != NULL)
 		free(srch_str);
-	if ((u_srch_str != NULL) && (*u_srch_str != (char) NULL))
+	if ((u_srch_str != NULL) && (*u_srch_str != 0))
 		free(u_srch_str);
 	srch_str = get_string(search_prompt_str, FALSE);
 	gold = FALSE;
 	srch_3 = srch_str;
 	srch_1 = u_srch_str = malloc(strlen(srch_str) + 1);
-	while (*srch_3 != (char) NULL)
+	while (*srch_3 != 0)
 	{
 		*srch_1 = toupper(*srch_3);
 		srch_1++;
 		srch_3++;
 	}
-	*srch_1 = (char) NULL;
+	*srch_1 = 0;
 	search(TRUE);
 }
 
@@ -2686,7 +2686,7 @@ undel_char(void) /* undelete last deleted character */
 	{
 		in = d_char[0];
 		insert(in);
-		if (d_char[1] != (unsigned char) NULL)
+		if (d_char[1] != 0)
 		{
 			in = d_char[1];
 			insert(in);
@@ -2728,7 +2728,7 @@ del_word(void) /* delete word in front of cursor */
 		d_word2++;
 		d_word3++;
 	}
-	*d_word2 = (char) NULL;
+	*d_word2 = 0;
 	d_wrd_len = difference = d_word2 - d_word;
 	d_word2 = point;
 	while (tposit < curr_line->line_length)
@@ -2739,7 +2739,7 @@ del_word(void) /* delete word in front of cursor */
 		d_word3++;
 	}
 	curr_line->line_length -= difference;
-	*d_word2 = (char) NULL;
+	*d_word2 = 0;
 	draw_line(scr_vert, scr_horz,point,position,curr_line->line_length);
 	d_char[0] = tmp_char[0];
 	d_char[1] = tmp_char[1];
@@ -2792,7 +2792,7 @@ undel_word(void) /* undelete last deleted word */
 	}
 	curr_line->line_length += d_wrd_len;
 	tmp_old_ptr = point;
-	*tmp_ptr = (char) NULL;
+	*tmp_ptr = 0;
 	tmp_ptr = tmp_space;
 	tposit = 1;
 	/*
@@ -2805,7 +2805,7 @@ undel_word(void) /* undelete last deleted word */
 		tmp_ptr++;
 		tmp_old_ptr++;
 	}
-	*tmp_old_ptr = (char) NULL;
+	*tmp_old_ptr = 0;
 	free(tmp_space);
 	draw_line(scr_vert, scr_horz, point, position, curr_line->line_length);
 }
@@ -2831,8 +2831,8 @@ del_line(void) /* delete from cursor to end of line */
 		tposit++;
 	}
 	dlt_line->line_length = 1 + tposit - position;
-	*dl1 = (char) NULL;
-	*point = (char) NULL;
+	*dl1 = 0;
+	*point = 0;
 	curr_line->line_length = position;
 	wclrtoeol(text_win);
 	if (curr_line->next_line != NULL)
@@ -2867,7 +2867,7 @@ undel_line(void) /* undelete last deleted line */
 		ud1++;
 		ud2++;
 	}
-	*ud1 = (char) NULL;
+	*ud1 = 0;
 	draw_line(scr_vert, scr_horz,point,position,curr_line->line_length);
 }
 
@@ -3011,7 +3011,7 @@ sh_command(char *string)	/* execute shell command			*/
 	if (!(path = getenv("SHELL")))
 		path = "/bin/sh";
 	last_slash = temp_point = path;
-	while (*temp_point != (char) NULL)
+	while (*temp_point != 0)
 	{
 		if (*temp_point == '/')
 			last_slash = ++temp_point;
@@ -3709,9 +3709,9 @@ file_op(int arg)
 			flag = FALSE;
 
 		string = in_file_name;
-		if ((string == NULL) || (*string == (char) NULL))
+		if ((string == NULL) || (*string == 0))
 			string = get_string(save_file_name_prompt, TRUE);
-		if ((string == NULL) || (*string == (char) NULL))
+		if ((string == NULL) || (*string == 0))
 		{
 			wmove(com_win, 0, 0);
 			wprintw(com_win, file_not_saved_msg);
@@ -3746,7 +3746,7 @@ shell_op(void)
 	char *string;
 
 	if (((string = get_string(shell_prompt, TRUE)) != NULL) && 
-			(*string != (char) NULL))
+			(*string != 0))
 	{
 		sh_command(string);
 		free(string);
@@ -3872,14 +3872,14 @@ Format(void)	/* format the paragraph according to set margins	*/
 	offset -= position;
 	counter = position;
 	line = temp1 = point;
-	while ((*temp1 != (char) NULL) && (*temp1 != ' ') && (*temp1 != '\t') && (counter < curr_line->line_length))
+	while ((*temp1 != 0) && (*temp1 != ' ') && (*temp1 != '\t') && (counter < curr_line->line_length))
 	{
 		*temp2 = *temp1;
 		temp2++;
 		temp1++;
 		counter++;
 	}
-	*temp2 = (char) NULL;
+	*temp2 = 0;
 	if (position != 1)
 		bol();
 	while (!Blank_Line(curr_line->prev_line))
@@ -4073,7 +4073,7 @@ ee_init(void)	/* check for init file and read it if it exists	*/
 				str1 = str2 = string;
 				while (*str2 != '\n')
 					str2++;
-				*str2 = (char) NULL;
+				*str2 = 0;
 
 				if (unique_test(string, init_strings) != 1)
 					continue;
@@ -4104,7 +4104,7 @@ ee_init(void)	/* check for init file and read it if it exists	*/
 				else if (compare(str1, Echo, FALSE))
 				{
 					str1 = next_word(str1);
-					if (*str1 != (char) NULL)
+					if (*str1 != 0)
 						echo_string(str1);
 				}
 				else if (compare(str1, PRINTCOMMAND, FALSE))
@@ -4228,7 +4228,7 @@ dump_ee_conf(void)
 		while ((string = fgets(buffer, 512, old_init_file)) != NULL)
 		{
 			length = strlen(string);
-			string[length - 1] = (char) NULL;
+			string[length - 1] = 0;
 
 			if (unique_test(string, init_strings) == 1)
 			{
@@ -4274,7 +4274,7 @@ echo_string(char *string)	/* echo the given string	*/
 	int Counter;
 
 		temp = string;
-		while (*temp != (char) NULL)
+		while (*temp != 0)
 		{
 			if (*temp == '\\')
 			{
@@ -4381,7 +4381,7 @@ first_word_len(struct text *test_line)
 		return(0);
 
 	pnt = test_line->line;
-	if ((pnt == NULL) || (*pnt == (char) NULL) || 
+	if ((pnt == NULL) || (*pnt == 0) ||
 	    (*pnt == '.') || (*pnt == '>'))
 		return(0);
 
@@ -4390,16 +4390,16 @@ first_word_len(struct text *test_line)
 		pnt = next_word(pnt);
 	}
 
-	if (*pnt == (char) NULL)
+	if (*pnt == 0)
 		return(0);
 
 	counter = 0;
-	while ((*pnt != (char) NULL) && ((*pnt != ' ') && (*pnt != '\t')))
+	while ((*pnt != 0) && ((*pnt != ' ') && (*pnt != '\t')))
 	{
 		pnt++;
 		counter++;
 	}
-	while ((*pnt != (char) NULL) && ((*pnt == ' ') || (*pnt == '\t')))
+	while ((*pnt != 0) && ((*pnt == ' ') || (*pnt == '\t')))
 	{
 		pnt++;
 		counter++;
@@ -4450,7 +4450,7 @@ Auto_Format(void)	/* format the paragraph according to set margins */
 	d_line = NULL;
 	auto_format = FALSE;
 	offset = position;
-	if ((position != 1) && ((*point == ' ') || (*point == '\t') || (position == curr_line->line_length) || (*point == (char) NULL)))
+	if ((position != 1) && ((*point == ' ') || (*point == '\t') || (position == curr_line->line_length) || (*point == 0)))
 		prev_word();
 	temp_dword = d_word;
 	temp_dwl = d_wrd_len;
@@ -4465,14 +4465,14 @@ Auto_Format(void)	/* format the paragraph according to set margins */
 	offset -= position;
 	counter = position;
 	line = temp1 = point;
-	while ((*temp1 != (char) NULL) && (*temp1 != ' ') && (*temp1 != '\t') && (counter < curr_line->line_length))
+	while ((*temp1 != 0) && (*temp1 != ' ') && (*temp1 != '\t') && (counter < curr_line->line_length))
 	{
 		*temp2 = *temp1;
 		temp2++;
 		temp1++;
 		counter++;
 	}
-	*temp2 = (char) NULL;
+	*temp2 = 0;
 	if (position != 1)
 		bol();
 	while (!Blank_Line(curr_line->prev_line))
@@ -4773,9 +4773,9 @@ is_in_string(char *string, char *substring)
 {
 	char *full, *sub;
 
-	for (sub = substring; (sub != NULL) && (*sub != (char)NULL); sub++)
+	for (sub = substring; (sub != NULL) && (*sub != 0); sub++)
 	{
-		for (full = string; (full != NULL) && (*full != (char)NULL); 
+		for (full = string; (full != NULL) && (*full != 0);
 				full++)
 		{
 			if (*sub == *full)
@@ -4817,7 +4817,7 @@ resolve_name(char *name)
 			slash = strchr(name, '/');
 			if (slash == NULL) 
 				return(name);
-			*slash = (char) NULL;
+			*slash = 0;
 			user = (struct passwd *) getpwnam((name + 1));
 			*slash = '/';
 		}
@@ -4837,10 +4837,10 @@ resolve_name(char *name)
 		tmp = buffer;
 		index = 0;
 		
-		while ((*tmp != (char) NULL) && (index < 1024))
+		while ((*tmp != 0) && (index < 1024))
 		{
 
-			while ((*tmp != (char) NULL) && (*tmp != '$') && 
+			while ((*tmp != 0) && (*tmp != '$') &&
 				(index < 1024))
 			{
 				long_buffer[index] = *tmp;
@@ -4856,7 +4856,7 @@ resolve_name(char *name)
 				if (*tmp == '{') /* } */	/* bracketed variable name */
 				{
 					tmp++;				/* { */
-					while ((*tmp != (char) NULL) && 
+					while ((*tmp != 0) &&
 						(*tmp != '}') && 
 						(counter < 128))
 					{
@@ -4869,7 +4869,7 @@ resolve_name(char *name)
 				}
 				else
 				{
-					while ((*tmp != (char) NULL) && 
+					while ((*tmp != 0) &&
 					       (*tmp != '/') && 
 					       (*tmp != '$') && 
 					       (counter < 128))
@@ -4879,7 +4879,7 @@ resolve_name(char *name)
 						tmp++;
 					}
 				}
-				short_buffer[counter] = (char) NULL;
+				short_buffer[counter] = 0;
 				if ((slash = getenv(short_buffer)) != NULL)
 				{
 					offset = strlen(slash);
@@ -4902,7 +4902,7 @@ resolve_name(char *name)
 		if (index == 1024)
 			return(buffer);
 		else
-			long_buffer[index] = (char) NULL;
+			long_buffer[index] = 0;
 
 		if (name != buffer)
 			free(buffer);
diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c
index 59a012a..ce71b6c 100644
--- a/usr.bin/hexdump/display.c
+++ b/usr.bin/hexdump/display.c
@@ -304,7 +304,6 @@ int
 next(char **argv)
 {
 	static int done;
-	int statok;
 
 	if (argv) {
 		_argv = argv;
@@ -318,14 +317,13 @@ next(char **argv)
 				++_argv;
 				continue;
 			}
-			statok = done = 1;
+			done = 1;
 		} else {
 			if (done++)
 				return(0);
-			statok = 0;
 		}
 		if (skip)
-			doskip(statok ? *_argv : "stdin", statok);
+			doskip(*_argv ? *_argv : "stdin");
 		if (*_argv)
 			++_argv;
 		if (!skip)
@@ -335,21 +333,17 @@ next(char **argv)
 }
 
 void
-doskip(const char *fname, int statok)
+doskip(const char *fname)
 {
 	int cnt;
 	struct stat sb;
 
-	if (statok) {
-		if (fstat(fileno(stdin), &sb))
-			err(1, "%s", fname);
-		if (S_ISREG(sb.st_mode) && skip >= sb.st_size) {
-			address += sb.st_size;
-			skip -= sb.st_size;
-			return;
-		}
-	}
-	if (S_ISREG(sb.st_mode)) {
+	if (fstat(fileno(stdin), &sb))
+		err(1, "%s", fname);
+	if (S_ISREG(sb.st_mode) && skip >= sb.st_size) {
+		address += sb.st_size;
+		skip -= sb.st_size;
+	} else if (S_ISREG(sb.st_mode)) {
 		if (fseeko(stdin, skip, SEEK_SET))
 			err(1, "%s", fname);
 		address += skip;
diff --git a/usr.bin/hexdump/hexdump.h b/usr.bin/hexdump/hexdump.h
index 9e6ea6f..cf9eae9 100644
--- a/usr.bin/hexdump/hexdump.h
+++ b/usr.bin/hexdump/hexdump.h
@@ -92,7 +92,7 @@ void	 bpad(PR *);
 void	 conv_c(PR *, u_char *);
 void	 conv_u(PR *, u_char *);
 void	 display(void);
-void	 doskip(const char *, int);
+void	 doskip(const char *);
 void	 escape(char *);
 u_char	*get(void);
 void	 newsyntax(int, char ***);
diff --git a/usr.bin/lex/flex.skl b/usr.bin/lex/flex.skl
index aff70d8..9881a8b 100644
--- a/usr.bin/lex/flex.skl
+++ b/usr.bin/lex/flex.skl
@@ -977,6 +977,7 @@ void yyFlexLexer::yyunput( int c, char* yy_bp )
 
 
 %-
+#ifndef YY_NO_INPUT
 #ifdef __cplusplus
 static int yyinput()
 #else
@@ -1056,6 +1057,9 @@ int yyFlexLexer::yyinput()
 
 	return c;
 	}
+%-
+#endif	/* ifndef YY_NO_INPUT */
+%*
 
 
 %-
diff --git a/usr.bin/make/buf.c b/usr.bin/make/buf.c
index 9b30f93..c7bb06b 100644
--- a/usr.bin/make/buf.c
+++ b/usr.bin/make/buf.c
@@ -96,7 +96,7 @@ BufExpand(Buffer *bp, size_t nb)
 /**
  * Add a single byte to the buffer.
  */
-inline void
+void
 Buf_AddByte(Buffer *bp, char byte)
 {
 	BufExpand(bp, 1);
diff --git a/usr.bin/shlock/shlock.c b/usr.bin/shlock/shlock.c
index bb3e28f..ca7c292 100644
--- a/usr.bin/shlock/shlock.c
+++ b/usr.bin/shlock/shlock.c
@@ -141,7 +141,6 @@ create_lock(const char *file, pid_t pid, int uucpstyle, int debug)
 		if (unlink(tmpf))
 			err(1, "could not remove temporary lock file %s", tmpf);
 
-		free(tmpf);
 		return(1);		
 	}
 
diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c
index 5f5a293..ef46fd4 100644
--- a/usr.bin/xlint/lint1/tree.c
+++ b/usr.bin/xlint/lint1/tree.c
@@ -1859,13 +1859,13 @@ cvtcon(op_t op, int arg, type_t *tp, val_t *nv, val_t *v)
 		case UQUAD:
 			max = (u_quad_t)UQUAD_MAX; min = 0;		break;
 		case FLOAT:
-			max = FLT_MAX;		min = -FLT_MAX;		break;
+			max = FLT_MAX;		min = FLT_MIN;		break;
 		case DOUBLE:
-			max = DBL_MAX;		min = -DBL_MAX;		break;
+			max = DBL_MAX;		min = DBL_MIN;		break;
 		case PTR:
 			/* Got already an error because of float --> ptr */
 		case LDOUBLE:
-			max = LDBL_MAX;		min = -LDBL_MAX;	break;
+			max = LDBL_MAX;		min = LDBL_MIN;		break;
 		default:
 			lerror("cvtcon() 1");
 		}
@@ -2835,11 +2835,11 @@ foldflt(tnode_t *tn)
 			/* division by 0 */
 			error(139);
 			if (t == FLOAT) {
-				v->v_ldbl = l < 0 ? -FLT_MAX : FLT_MAX;
+				v->v_ldbl = l < 0 ? FLT_MIN : FLT_MAX;
 			} else if (t == DOUBLE) {
-				v->v_ldbl = l < 0 ? -DBL_MAX : DBL_MAX;
+				v->v_ldbl = l < 0 ? DBL_MIN : DBL_MAX;
 			} else {
-				v->v_ldbl = l < 0 ? -LDBL_MAX : LDBL_MAX;
+				v->v_ldbl = l < 0 ? LDBL_MIN : LDBL_MAX;
 			}
 		} else {
 			v->v_ldbl = l / r;
@@ -2877,17 +2877,17 @@ foldflt(tnode_t *tn)
 		lerror("foldflt() 5");
 	if (isinf((double)v->v_ldbl) ||
 	    (t == FLOAT &&
-	     (v->v_ldbl > FLT_MAX || v->v_ldbl < -FLT_MAX)) ||
+	     (v->v_ldbl > FLT_MAX || v->v_ldbl < FLT_MIN)) ||
 	    (t == DOUBLE &&
-	     (v->v_ldbl > DBL_MAX || v->v_ldbl < -DBL_MAX))) {
+	     (v->v_ldbl > DBL_MAX || v->v_ldbl < DBL_MIN))) {
 		/* floating point overflow detected, op %s */
 		warning(142, modtab[tn->tn_op].m_name);
 		if (t == FLOAT) {
-			v->v_ldbl = v->v_ldbl < 0 ? -FLT_MAX : FLT_MAX;
+			v->v_ldbl = v->v_ldbl < 0 ? FLT_MIN : FLT_MAX;
 		} else if (t == DOUBLE) {
-			v->v_ldbl = v->v_ldbl < 0 ? -DBL_MAX : DBL_MAX;
+			v->v_ldbl = v->v_ldbl < 0 ? DBL_MIN : DBL_MAX;
 		} else {
-			v->v_ldbl = v->v_ldbl < 0 ? -LDBL_MAX: LDBL_MAX;
+			v->v_ldbl = v->v_ldbl < 0 ? LDBL_MIN : LDBL_MAX;
 		}
 	}
 
diff --git a/usr.sbin/acpi/Makefile.inc b/usr.sbin/acpi/Makefile.inc
index 68e4096..fe45796 100644
--- a/usr.sbin/acpi/Makefile.inc
+++ b/usr.sbin/acpi/Makefile.inc
@@ -18,7 +18,7 @@ SRCS+=		${.OBJDIR}/acpi.h ${.OBJDIR}/platform/acenv.h
 CLEANFILES+=	${.OBJDIR}/acpi.h
 CLEANDIRS+=	${.OBJDIR}/platform
 
-WARNS?=		1
+WARNS?=		0
 
 .if exists(${.CURDIR}/../../Makefile.inc)
 .include "${.CURDIR}/../../Makefile.inc"
diff --git a/usr.sbin/ancontrol/ancontrol.c b/usr.sbin/ancontrol/ancontrol.c
index 97ab3c3..4043e8d 100644
--- a/usr.sbin/ancontrol/ancontrol.c
+++ b/usr.sbin/ancontrol/ancontrol.c
@@ -1464,7 +1464,7 @@ an_enable_leap_mode(const char *iface, char *username)
 
 	caps = (struct an_ltv_caps *)&areq;
 
-	if (!caps->an_softcaps & AN_AUTHTYPE_LEAP) {
+	if (!(caps->an_softcaps & AN_AUTHTYPE_LEAP)) {
 		fprintf(stderr, "Firmware does not support LEAP\n");
 		exit(1);
 	}
diff --git a/usr.sbin/config/lang.l b/usr.sbin/config/lang.l
index 938135c..baf0189 100644
--- a/usr.sbin/config/lang.l
+++ b/usr.sbin/config/lang.l
@@ -41,6 +41,7 @@
 #include "y.tab.h"
 #include "config.h"
 
+#define YY_NO_INPUT
 #define YY_NO_UNPUT
 
 /*
diff --git a/usr.sbin/ndiscvt/inf-token.l b/usr.sbin/ndiscvt/inf-token.l
index e244b2e..719db00 100644
--- a/usr.sbin/ndiscvt/inf-token.l
+++ b/usr.sbin/ndiscvt/inf-token.l
@@ -43,6 +43,7 @@
 #include "y.tab.h"
 
 int lineno = 1;
+#define YY_NO_INPUT
 #define YY_NO_UNPUT
 
 int yylex(void);
diff --git a/usr.sbin/nsupdate/Makefile b/usr.sbin/nsupdate/Makefile
index aaa0c8d..1cb1b9a 100644
--- a/usr.sbin/nsupdate/Makefile
+++ b/usr.sbin/nsupdate/Makefile
@@ -11,6 +11,7 @@ USE_LIBISC=	yes
 
 PROG=	nsupdate
 SRCS=	nsupdate.c
+WARNS?=	0
 
 CFLAGS+= -I${.CURDIR}/../../usr.sbin/named \
 	-I${.CURDIR}/../../usr.sbin/named/include \
diff --git a/usr.sbin/rrenumd/lexer.l b/usr.sbin/rrenumd/lexer.l
index 6c032b2..307b1f6 100644
--- a/usr.sbin/rrenumd/lexer.l
+++ b/usr.sbin/rrenumd/lexer.l
@@ -33,6 +33,7 @@
  */
 
 %{
+#define YY_NO_INPUT
 #define YY_NO_UNPUT
 
 #include <sys/param.h>
diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c
index b0aaebf..61731bd 100644
--- a/usr.sbin/rtadvd/rrenum.c
+++ b/usr.sbin/rtadvd/rrenum.c
@@ -180,7 +180,7 @@ do_use_prefix(int len, struct rr_pco_match *rpm,
 		irr->irr_u_uselen = rpu->rpu_uselen;
 		irr->irr_u_keeplen = rpu->rpu_keeplen;
 		irr->irr_raf_mask_onlink =
-			(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK);
+			(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK) == 0 ? 0 : 1;
 		irr->irr_raf_mask_auto =
 			(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_AUTO);
 		irr->irr_vltime = ntohl(rpu->rpu_vltime);
diff --git a/usr.sbin/setkey/token.l b/usr.sbin/setkey/token.l
index 27d9e8a..a0f7865 100644
--- a/usr.sbin/setkey/token.l
+++ b/usr.sbin/setkey/token.l
@@ -69,6 +69,8 @@
 
 #define PREPROC	DECHO CMDARG
 
+#define YY_NO_INPUT
+
 int lineno = 1;
 char cmdarg[8192]; /* XXX: BUFSIZ is the better ? */
 
