334f632b16
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
63 lines
2.0 KiB
Diff
63 lines
2.0 KiB
Diff
Avoid implicit function declarations in the configure script.
|
|
The undeclared exit function comes from autoconf-generated code.
|
|
The SHUT_RD and h_errno checks are specific to the spamassassin
|
|
package.
|
|
|
|
Submitted upstream: <https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8076>
|
|
|
|
diff --git a/spamc/configure b/spamc/configure
|
|
index d8e5dcf8a21d6a3d..5472d2b009fb9083 100755
|
|
--- a/spamc/configure
|
|
+++ b/spamc/configure
|
|
@@ -2624,8 +2624,8 @@ main ()
|
|
for (i = 0; i < 256; i++)
|
|
if (XOR (islower (i), ISLOWER (i))
|
|
|| toupper (i) != TOUPPER (i))
|
|
- exit(2);
|
|
- exit (0);
|
|
+ return 2;
|
|
+ return 0;
|
|
}
|
|
_ACEOF
|
|
rm -f conftest$ac_exeext
|
|
@@ -3553,6 +3553,7 @@ _ACEOF
|
|
cat confdefs.h >>conftest.$ac_ext
|
|
cat >>conftest.$ac_ext <<_ACEOF
|
|
/* end confdefs.h. */
|
|
+#include <stdio.h>
|
|
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
int
|
|
@@ -4252,6 +4253,7 @@ _ACEOF
|
|
cat confdefs.h >>conftest.$ac_ext
|
|
cat >>conftest.$ac_ext <<_ACEOF
|
|
/* end confdefs.h. */
|
|
+#include <stdio.h>
|
|
#include <netdb.h>
|
|
int
|
|
main ()
|
|
diff --git a/spamc/configure.in b/spamc/configure.in
|
|
index 42cc998412075086..96769105ef640bc8 100644
|
|
--- a/spamc/configure.in
|
|
+++ b/spamc/configure.in
|
|
@@ -47,7 +47,8 @@ dnl ----------------------------------------------------------------------
|
|
|
|
AC_CACHE_CHECK([for SHUT_RD],
|
|
shutrd, [
|
|
- AC_TRY_COMPILE([#include <sys/types.h>
|
|
+ AC_TRY_COMPILE([#include <stdio.h>
|
|
+#include <sys/types.h>
|
|
#include <sys/socket.h>],
|
|
[printf ("%d", SHUT_RD); return 0;],
|
|
[shutrd=yes],
|
|
@@ -89,7 +90,8 @@ dnl ----------------------------------------------------------------------
|
|
|
|
AC_CACHE_CHECK([for h_errno],
|
|
herrno, [
|
|
- AC_TRY_COMPILE([#include <netdb.h>],
|
|
+ AC_TRY_COMPILE([#include <stdio.h>
|
|
+#include <netdb.h>],
|
|
[printf ("%d", h_errno); return 0;],
|
|
[herrno=yes],
|
|
[herrno=no]),
|