Re: using -Werror-implicit-function-declaration

2014-07-11 Thread Florian Obser
usr.sbin, missing prototypes:

diff --git usr.sbin/mrouted/defs.h usr.sbin/mrouted/defs.h
index 4c9224a..45b060f 100644
--- usr.sbin/mrouted/defs.h
+++ usr.sbin/mrouted/defs.h
@@ -209,6 +209,7 @@ extern void accept_leave_message(u_int32_t src, 
u_int32_t dst,
u_int32_t group);
 extern voidaccept_membership_query(u_int32_t src, u_int32_t dst,
u_int32_t group, int tmo);
+extern voidinit_installvifs(void);
 
 /* config.c */
 extern voidconfig_vifs_from_kernel(void);
@@ -223,6 +224,8 @@ extern char *   inet_fmt(u_int32_t addr, char 
*s);
 extern char *  inet_fmts(u_int32_t addr, u_int32_t mask, char *s);
 extern u_int32_t   inet_parse(char *s);
 extern int inet_cksum(u_int16_t *addr, u_int len);
+extern int inet_valid_host(u_int32_t naddr);
+extern int inet_valid_mask(u_int32_t mask);
 
 /* prune.c */
 extern unsignedkroutes;


-- 
I'm not entirely sure you are real.



Re: using -Werror-implicit-function-declaration

2014-07-11 Thread Florian Obser
usr.sbin, fix bind configure:
Carefully checked that config.h and generated Makefiles don't change.

diff --git usr.sbin/bind/configure usr.sbin/bind/configure
index 6e280ad..db02979 100644
--- usr.sbin/bind/configure
+++ usr.sbin/bind/configure
@@ -4596,6 +4596,8 @@ cat confdefs.h conftest.$ac_ext
 cat conftest.$ac_ext _ACEOF
 /* end confdefs.h.  */
 
+int foo1();
+
 int
 main ()
 {
@@ -5697,6 +5699,7 @@ cat conftest.$ac_ext _ACEOF
 /* end confdefs.h.  */
 
 #include openssl/err.h
+#include openssl/dso.h
 int
 main ()
 {
@@ -5738,6 +5741,7 @@ cat conftest.$ac_ext _ACEOF
 /* end confdefs.h.  */
 
 #include openssl/err.h
+#include openssl/dso.h
 
 int
 main ()
@@ -26856,6 +26860,8 @@ cat conftest.$ac_ext _ACEOF
 /* end confdefs.h.  */
 
 #include stdio.h
+#include stdlib.h
+#include string.h
 main() {
long long int j = 0;
char buf[100];
@@ -28439,6 +28445,7 @@ cat confdefs.h conftest.$ac_ext
 cat conftest.$ac_ext _ACEOF
 /* end confdefs.h.  */
 
+#include stdlib.h
 main() {
exit((sizeof(void *) == 8) ? 0 : 1);
 }


-- 
I'm not entirely sure you are real.



Re: using -Werror-implicit-function-declaration

2014-07-11 Thread Florian Obser
usr.sbin, fix nsd/unbound configure
carefully checked that config.h and generated Makefiles don't change.

need for _XOPEN_VERSION pointed out by guenther@

diff --git usr.sbin/nsd/configure usr.sbin/nsd/configure
index d2d28c1..c2a40e8 100644
--- usr.sbin/nsd/configure
+++ usr.sbin/nsd/configure
@@ -6117,6 +6117,7 @@ else
 /* end confdefs.h.  */
 
 #define _XOPEN_SOURCE
+#define _XOPEN_VERSION 4
 #include time.h
 int main(void) { struct tm tm; char *res;
 res = strptime(20070207111842, %Y%m%d%H%M%S, tm);
diff --git usr.sbin/unbound/configure usr.sbin/unbound/configure
index e540ec0..336c955 100644
--- usr.sbin/unbound/configure
+++ usr.sbin/unbound/configure
@@ -15119,6 +15119,7 @@ else
 /* end confdefs.h.  */
 
 #define _XOPEN_SOURCE
+#define _XOPEN_VERSION 4
 #include time.h
 int main(void) { struct tm tm; char *res;
 res = strptime(2010-07-15T00:00:00+00:00, 
%t%Y%t-%t%m%t-%t%d%tT%t%H%t:%t%M%t:%t%S%t, tm);

-- 
I'm not entirely sure you are real.



Re: using -Werror-implicit-function-declaration

2014-07-11 Thread Florian Obser
usr.sbin; enable -Werror-implicit-function-declaration:

This has currently no effect on subdirs using Makefile.bsd-wrapper
(bind, nginx, nsd, unbound). This is beeing worked on. With a
workaround they have been tested and with the previous diffs are
clean.

diff --git usr.sbin/Makefile.inc usr.sbin/Makefile.inc
index 65a01f8..5e0b499 100644
--- usr.sbin/Makefile.inc
+++ usr.sbin/Makefile.inc
@@ -1,3 +1,4 @@
 #  $OpenBSD: Makefile.inc,v 1.2 1997/09/21 11:43:04 deraadt Exp $
 
 BINDIR?=   /usr/sbin
+COPTS+=-Werror-implicit-function-declaration


-- 
I'm not entirely sure you are real.



Re: using -Werror-implicit-function-declaration

2014-07-11 Thread Ted Unangst
On Fri, Jul 11, 2014 at 14:09, Florian Obser wrote:
 usr.sbin, make sure subdirs of subdirs see usr.sbin/Makefile.inc:
 
 Does the same thing as lpr/pac and pppd/pppstats. I have no idea if
 this is the right way, but it seems to work. Cluebats welcome.

I think maybe it would be nicer to create a Makefile.inc in .. and
have that include ../../Makefile.inc in some cases? That would work
more automagically?



Re: using -Werror-implicit-function-declaration

2014-07-11 Thread Marc Espie
On Fri, Jul 11, 2014 at 10:27:57AM -0400, Ted Unangst wrote:
 On Fri, Jul 11, 2014 at 14:09, Florian Obser wrote:
  usr.sbin, make sure subdirs of subdirs see usr.sbin/Makefile.inc:
  
  Does the same thing as lpr/pac and pppd/pppstats. I have no idea if
  this is the right way, but it seems to work. Cluebats welcome.
 
 I think maybe it would be nicer to create a Makefile.inc in .. and
 have that include ../../Makefile.inc in some cases? That would work
 more automagically?

Avoiding multiple inclusions is somewhat hard...



Re: using -Werror-implicit-function-declaration

2014-07-10 Thread Florian Obser
/sbin:

diff --git sbin/Makefile.inc sbin/Makefile.inc
index 1b14860..92ca312 100644
--- sbin/Makefile.inc
+++ sbin/Makefile.inc
@@ -2,3 +2,4 @@
 
 BINDIR?=   /sbin
 LDSTATIC=  ${STATIC}
+CFLAGS+=   -Werror-implicit-function-declaration
diff --git sbin/disklabel/editor.c sbin/disklabel/editor.c
index ab8d036..a56927a 100644
--- sbin/disklabel/editor.c
+++ sbin/disklabel/editor.c
@@ -137,8 +137,6 @@ voidfind_bounds(struct disklabel *);
 void   set_bounds(struct disklabel *);
 void   set_duid(struct disklabel *);
 struct diskchunk *free_chunks(struct disklabel *);
-void   mpcopy(char **, char **);
-void   mpfree(char **);
 intmicmp(const void *, const void *);
 intmpequal(char **, char **);
 intget_bsize(struct disklabel *, int);
diff --git sbin/disklabel/extern.h sbin/disklabel/extern.h
index 05f84f2..c2f64ca 100644
--- sbin/disklabel/extern.h
+++ sbin/disklabel/extern.h
@@ -32,6 +32,8 @@ struct disklabel *makebootarea(char *, struct disklabel *);
 inteditor(int);
 void   editor_allocspace(struct disklabel *);
 void   mpsave(struct disklabel *);
+void   mpcopy(char **, char **);
+void   mpfree(char **);
 
 intwritelabel(int, char *, struct disklabel *);
 extern  char bootarea[], *specname, *fstabfile;


-- 
I'm not entirely sure you are real.