openssh/openssh-configure-c99-3.patch
Florian Weimer d5591fb5ab C99 compatiblity fixes
Apply upstream patches from the portable OpenSSH project to fix
C99 compatibility issues in the configure script.

For the PAM agent integration, apply a custom downstream fix,
as the proposed upstream changes have not been merged yet.

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
2023-04-12 12:07:21 +02:00

42 lines
1.2 KiB
Diff

commit 5eb796a369c64f18d55a6ae9b1fa9b35eea237fb
Author: Harmen Stoppels <harmenstoppels@gmail.com>
Date: Thu Oct 13 16:08:46 2022 +0200
Fix snprintf configure test for clang 15
Clang 15 -Wimplicit-int defaults to an error in C99 mode and above.
A handful of tests have "main(..." and not "int main(..." which caused
the tests to produce incorrect results.
diff --git a/configure.ac b/configure.ac
index de60a1b1..165c49de 100644
--- a/configure.ac
+++ b/configure.ac
@@ -713,7 +713,7 @@ case "$host" in
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <mach-o/dyld.h>
#include <stdlib.h>
-main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
+int main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
exit(0);
else
exit(1);
@@ -4259,7 +4259,7 @@ dnl test snprintf (broken on SCO w/gcc)
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_SNPRINTF
-main()
+int main()
{
char buf[50];
char expected_out[50];
@@ -4276,7 +4276,7 @@ main()
exit(0);
}
#else
-main() { exit(0); }
+int main() { exit(0); }
#endif
]])], [ true ], [ AC_DEFINE([BROKEN_SNPRINTF]) ],
AC_MSG_WARN([cross compiling: Assuming working snprintf()])