Blob Blame History Raw
Avoid implicit int and implicit function declarations.  Fixes build
failures with future compilers.

Submitted upstream: <https://github.com/Netatalk/netatalk/pull/294>

The macros/largefile-check.m4 part was already fixed upstrem in
commit a08e6137afaf8f6ec2139c250482c8515ceb3e2f ("fix largefile-check
macro for largefile").

diff --git a/macros/iconv.m4 b/macros/iconv.m4
index 4805662d7e3933d0..1b4eb4284fbbb8c9 100644
--- a/macros/iconv.m4
+++ b/macros/iconv.m4
@@ -62,7 +62,7 @@ dnl	# check for iconv usability
 	AC_CACHE_CHECK([for working iconv],netatalk_cv_HAVE_USABLE_ICONV,[
 		AC_TRY_RUN([\
 #include <iconv.h>
-main() {
+int main(void) {
        iconv_t cd = iconv_open("ASCII", "UTF-8");
        if (cd == 0 || cd == (iconv_t)-1) return -1;
        return 0;
diff --git a/macros/largefile-check.m4 b/macros/largefile-check.m4
index 8610f5ee23806b87..12b8a2ba93c8b62e 100644
--- a/macros/largefile-check.m4
+++ b/macros/largefile-check.m4
@@ -60,7 +60,7 @@ if test "$enable_largefile" != no; then
     AC_TRY_RUN([#include <stdio.h>
 #include <stdlib.h>
 #include <sys/stat.h>
-main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
+int main(void) { exit((sizeof(off_t) == 8) ? 0 : 1); }],
 netatalk_cv_SIZEOF_OFF_T=yes,netatalk_cv_SIZEOF_OFF_T=no,netatalk_cv_SIZEOF_OFF_T=cross)])
 
     AC_MSG_CHECKING([if large file support is available])
diff --git a/macros/netatalk.m4 b/macros/netatalk.m4
index 8d4237349e917aa8..a6fbe94df91b63db 100644
--- a/macros/netatalk.m4
+++ b/macros/netatalk.m4
@@ -1207,6 +1207,7 @@ AC_DEFUN([AC_NETATALK_REALPATH], [
 AC_CACHE_CHECK([if the realpath function allows a NULL argument],
     neta_cv_REALPATH_TAKES_NULL, [
         AC_RUN_IFELSE([AC_LANG_SOURCE([[
+	    #include <stdlib.h>
             #include <stdio.h>
             #include <limits.h>
             #include <signal.h>
@@ -1215,7 +1216,7 @@ AC_CACHE_CHECK([if the realpath function allows a NULL argument],
                  exit(1);
             }
 
-            main() {
+            int main(void) {
                 char *newpath;
                 signal(SIGSEGV, exit_on_core);
                 newpath = realpath("/tmp", NULL);
diff --git a/macros/tcp-wrappers.m4 b/macros/tcp-wrappers.m4
index 76b75a09cd05a85d..9cc42a382d2912d0 100644
--- a/macros/tcp-wrappers.m4
+++ b/macros/tcp-wrappers.m4
@@ -18,14 +18,14 @@ AC_DEFUN([AC_NETATALK_TCP_WRAPPERS], [
 		saved_LIBS=$LIBS
 		W_LIBS="-lwrap" 
 		LIBS="$LIBS $W_LIBS"
-		AC_TRY_LINK([ int allow_severity = 0; int deny_severity = 0;]
+		AC_TRY_LINK([ int allow_severity = 0; int deny_severity = 0; extern char hosts_access(void);]
 			,[hosts_access();]
 			, netatalk_cv_tcpwrap=yes , 
    			[
 				LIBS=$saved_LIBS
 				W_LIBS="-lwrap -lnsl" 
 				LIBS="$LIBS $W_LIBS"
-				AC_TRY_LINK([ int allow_severity = 0; int deny_severity = 0;]
+				AC_TRY_LINK([ int allow_severity = 0; int deny_severity = 0; extern char hosts_access(void);]
 					,[hosts_access();]
 					, netatalk_cv_tcpwrap=yes , netatalk_cv_tcpwrap=no)
 			]