commit 21d898f96dd02101759fcea39980aa81381b532a
parent b34b6bdc740c611ffbba62269a13a559a3bc9aac
Author: Rolf Eike Beer <eike@sf-mail.de>
Date: Sat, 6 Jun 2020 22:30:50 +0200
add all missing headers
The only thing not added is <stdio.h>, which will cause collisions with puts().
Diffstat:
20 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/.cirrus.yml b/.cirrus.yml
@@ -14,7 +14,7 @@ task:
pkginstall_script:
- pkg install -y groff pkgconf check
configure_script:
- - echo "clang -O2 -Wall -Wshadow" > conf-cc
+ - echo "clang -O2 -Wall -Wshadow -Werror=implicit-function-declaration" > conf-cc
compile_script:
- make ${MAKE_FLAGS} it man
test_script:
diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml
@@ -17,7 +17,7 @@ jobs:
- name: test_deps
run: sudo apt-get install check
- name: configure
- run: echo "cc -O2 -Wall -Wshadow" > conf-cc
+ run: echo "cc -O2 -Wall -Wshadow -Werror=implicit-function-declaration" > conf-cc
- name: make
run: make it man
- name: make check
diff --git a/.travis.yml b/.travis.yml
@@ -14,7 +14,7 @@ addons:
- pkg-config
- check
script:
- - echo "${CC} -O2 -Wall -Wshadow" > conf-cc
+ - echo "${CC} -O2 -Wall -Wshadow -Werror=implicit-function-declaration" > conf-cc
- if [ -n "${FORCE_UTMP}" ]; then cp qtmp.h1 qtmp.h; fi
- if [ -n "${AVOID_NROFF}" ]; then NROFF=true; export NROFF; fi
- make ${MAKEFLAGS} it man
diff --git a/cdb_seek.c b/cdb_seek.c
@@ -1,5 +1,6 @@
#include <sys/types.h>
#include <errno.h>
+#include <unistd.h>
#include "cdb.h"
#ifndef SEEK_SET
diff --git a/fd_copy.c b/fd_copy.c
@@ -1,4 +1,5 @@
#include <fcntl.h>
+#include <unistd.h>
#include "fd.h"
int fd_copy(to,from)
diff --git a/fd_move.c b/fd_move.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
#include "fd.h"
int fd_move(to,from)
diff --git a/ipme.c b/ipme.c
@@ -8,6 +8,7 @@
#ifndef SIOCGIFCONF /* whatever works */
#include <sys/sockio.h>
#endif
+#include <unistd.h>
#include "hassalen.h"
#include "byte.h"
#include "ip.h"
diff --git a/maildir.c b/maildir.c
@@ -1,5 +1,6 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <unistd.h>
#include "prioq.h"
#include "env.h"
#include "stralloc.h"
diff --git a/maildir2mbox.c b/maildir2mbox.c
@@ -1,3 +1,4 @@
+#include <sys/stat.h>
#include "readwrite.h"
#include "prioq.h"
#include "env.h"
@@ -14,6 +15,8 @@
#include "myctime.h"
#include "maildir.h"
+extern int rename(const char *, const char *);
+
char *mbox;
char *mboxtmp;
diff --git a/maildirmake.c b/maildirmake.c
@@ -1,3 +1,4 @@
+#include <sys/stat.h>
#include "strerr.h"
#include "exit.h"
diff --git a/newfield.c b/newfield.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
#include "fmt.h"
#include "datetime.h"
#include "stralloc.h"
diff --git a/qmail-newmrh.c b/qmail-newmrh.c
@@ -1,3 +1,4 @@
+#include <sys/stat.h>
#include "case.h"
#include "strerr.h"
#include "stralloc.h"
@@ -11,6 +12,8 @@
#define FATAL "qmail-newmrh: fatal: "
+extern int rename(const char *, const char *);
+
void die_read()
{
strerr_die2sys(111,FATAL,"unable to read control/morercpthosts: ");
diff --git a/qmail-newu.c b/qmail-newu.c
@@ -1,3 +1,4 @@
+#include <sys/stat.h>
#include "stralloc.h"
#include "subfd.h"
#include "getln.h"
@@ -11,6 +12,8 @@
#include "case.h"
#include "auto_qmail.h"
+extern int rename(const char *, const char *);
+
void die_temp() { _exit(111); }
void die_chdir()
diff --git a/qmail-pop3d.c b/qmail-pop3d.c
@@ -22,6 +22,8 @@
void die() { _exit(0); }
+extern int rename(const char *, const char *);
+
int saferead(fd,buf,len) int fd; char *buf; int len;
{
int r;
diff --git a/qmail-send.c b/qmail-send.c
@@ -1,5 +1,6 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <utime.h>
#include "readwrite.h"
#include "sig.h"
#include "direntry.h"
diff --git a/qmail-start.c b/qmail-start.c
@@ -1,3 +1,4 @@
+#include <sys/stat.h>
#include "fd.h"
#include "prot.h"
#include "exit.h"
diff --git a/remoteinfo.c b/remoteinfo.c
@@ -2,6 +2,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <fcntl.h>
+#include <unistd.h>
#include "byte.h"
#include "substdio.h"
#include "ip.h"
diff --git a/seek.h b/seek.h
@@ -6,10 +6,7 @@
typedef off_t seek_pos;
-static inline seek_pos seek_cur(int fd)
-{
- return lseek(fd, 0, SEEK_CUR);
-}
+#define seek_cur(fd) (lseek((fd), 0, SEEK_CUR))
static inline int seek_set(int fd, seek_pos pos)
{
@@ -26,11 +23,7 @@ static inline int seek_end(int fd)
return 0;
}
-static inline int seek_trunc(int fd, seek_pos pos)
-{
- return ftruncate(fd, pos);
-}
-
+#define seek_trunc(fd, pos) (ftruncate((fd),(pos)))
#define seek_begin(fd) (seek_set((fd),(seek_pos) 0))
#endif
diff --git a/trigger.c b/trigger.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
#include "select.h"
#include "open.h"
#include "trigger.h"
diff --git a/triggerpull.c b/triggerpull.c
@@ -1,3 +1,4 @@
+#include <unistd.h>
#include "ndelay.h"
#include "open.h"
#include "triggerpull.h"