[openssh-commits] [openssh] branch master updated: declare defeat trying to detect C89 compilers
git+noreply at mindrot.org
git+noreply at mindrot.org
Mon Sep 9 17:32:16 AEST 2024
This is an automated email from the git hooks/post-receive script.
djm pushed a commit to branch master
in repository openssh.
The following commit(s) were added to refs/heads/master by this push:
new 27358121 declare defeat trying to detect C89 compilers
27358121 is described below
commit 273581210c99ce7275b8efdefbb9f89e1c22e341
Author: Damien Miller <djm at mindrot.org>
AuthorDate: Mon Sep 9 17:30:38 2024 +1000
declare defeat trying to detect C89 compilers
I can't find a reliable way to detect the features the ML-KEM code
requires in configure. Give up for now and use VLA support (that we
can detect) as a proxy for "old compiler" and turn off ML-KEM if
it isn't supported.
---
configure.ac | 14 --------------
defines.h | 6 ++----
2 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/configure.ac b/configure.ac
index 954de6ca..591d5a38 100644
--- a/configure.ac
+++ b/configure.ac
@@ -353,20 +353,6 @@ AC_COMPILE_IFELSE(
[ AC_MSG_RESULT([no]) ]
)
-AC_MSG_CHECKING([if compiler supports compound literals])
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[#include <stdlib.h>]],
- [[ struct foo { int bar; int baz; };
- void *fooc = &(struct foo){.bar = 1, .baz = 2};
- struct foo *foo2 = (struct foo *)fooc;
- return (foo2->bar == 1 && foo2->baz == 2) ? 0 : 1;
- ]])],
- [ AC_MSG_RESULT([yes])
- AC_DEFINE(COMPOUND_LITERALS, [1],
- [compiler supports compound literals]) ],
- [ AC_MSG_RESULT([no]) ]
-)
-
AC_MSG_CHECKING([if compiler accepts variable declarations after code])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <stdlib.h>]],
diff --git a/defines.h b/defines.h
index 3d03b033..ed860e78 100644
--- a/defines.h
+++ b/defines.h
@@ -940,10 +940,8 @@ struct winsize {
* so only enable if the compiler supports them.
*/
#if defined(VARIABLE_LENGTH_ARRAYS) && defined(VARIABLE_DECLARATION_AFTER_CODE)
-# define USE_SNTRUP761X25519 1
-#endif
-/* The ML-KEM768 imlementation similarly uses C99 compound literals */
-#ifdef COMPOUND_LITERALS
+# define USE_SNTRUP761X25519 1
+/* The ML-KEM768 implementation also uses C89 features */
# define USE_MLKEM768X25519 1
#endif
#endif /* _DEFINES_H */
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list