Commit Diff


commit - cd4ec459ec584d645acf6873b22b9f4f9e687cd9
commit + b6e88a9aeb1059c09b43530fac12ba1bbec93f99
blob - bb59c0e04cff956d719f500bc85d2ed630b89008
blob + ec01916f9c4a82ceaca4f88ee43e420aa800d05e
--- Makefile
+++ Makefile
@@ -7,6 +7,10 @@ BINDIR=	/usr/bin
 BINOWN= root
 BINMODE=4555
 
-COPTS+=	-Wall
+CFLAGS+=	-Wall
+CFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes
+CFLAGS+=	-Wmissing-declarations
+CFLAGS+=	-Wshadow -Wpointer-arith -Wcast-qual
+CFLAGS+=	-Wsign-compare
 
 .include <bsd.prog.mk>
blob - db8675dd8c4216230273622f9f299cf3ffd79d6f
blob + 8473bc9f140e64b23083dcb15f2bc8d8a80d7447
--- parse.y
+++ parse.y
@@ -205,7 +205,8 @@ int
 yylex(void)
 {
 	char buf[1024], *ebuf, *p, *str;
-	int i, c, quotes = 0, escape = 0, qpos = -1, nonkw = 0;
+	int c, quotes = 0, escape = 0, qpos = -1, nonkw = 0;
+	size_t i;
 
 	p = buf;
 	ebuf = buf + sizeof(buf);
blob - 789f88be02e9d1b536dea3344011e8058451cc72
blob + f83aa5458eac14fa9fbf4f4755df01795f994573
--- vias.c
+++ vias.c
@@ -48,7 +48,7 @@ usage(void)
 }
 
 size_t
-arraylen(const char **arr)
+arraylen(const char * const*arr)
 {
 	size_t cnt = 0;
 
@@ -459,7 +459,7 @@ main(int argc, char **argv)
 	syslog(LOG_AUTHPRIV | LOG_INFO, "%s edited %s from %s",
 	    myname, file, cwd);
 
-	if ((eargv = reallocarray(NULL, arraylen((const char **) argv) + 2,
+	if ((eargv = reallocarray(NULL, arraylen((const char * const*)argv) + 2,
 	    sizeof(*eargv))) == NULL) {
 		unlink(tmpfile);
 		err(1, NULL);
blob - 1e8734bbceeb2422784892612a5fdcdbf807e31a
blob + 4400913c633b851d4cc720bfbf1adcddf316e597
--- vias.h
+++ vias.h
@@ -10,7 +10,7 @@ extern struct rule **rules;
 extern int nrules, maxrules;
 extern int parse_errors;
 
-size_t arraylen(const char **);
+size_t arraylen(const char * const*);
 
 #define PERMIT	1
 #define DENY	2