[openssh-commits] [openssh] branch master updated: fix previous; check for C99 compound literals
git+noreply at mindrot.org
git+noreply at mindrot.org
Mon Sep 9 16:48:12 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 e8a0f19b fix previous; check for C99 compound literals
e8a0f19b is described below
commit e8a0f19b56dfa20f98ea9876d7171ec315fb338a
Author: Damien Miller <djm at mindrot.org>
AuthorDate: Mon Sep 9 16:46:40 2024 +1000
fix previous; check for C99 compound literals
The previous commit was incorrect (or at least insufficient), the
ML-KEM code is actually using compound literals, so test for them.
---
configure.ac | 13 +++++++------
defines.h | 4 ++--
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9b8b1ded..954de6ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -353,16 +353,17 @@ AC_COMPILE_IFELSE(
[ AC_MSG_RESULT([no]) ]
)
-AC_MSG_CHECKING([if compiler supports named struct initialisers])
+AC_MSG_CHECKING([if compiler supports compound literals])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <stdlib.h>]],
- [[ struct foo { int bar; int baz; };
- struct foo blerg = {.bar = 1, .baz = 2};
- exit((blerg.bar == 1 && blerg.baz == 2) ? 0 : 1);
+ [[ 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(NAMED_STRUCT_INITIALISERS, [1],
- [compiler supports named struct initializers]) ],
+ AC_DEFINE(COMPOUND_LITERALS, [1],
+ [compiler supports compound literals]) ],
[ AC_MSG_RESULT([no]) ]
)
diff --git a/defines.h b/defines.h
index d1f6ce33..3d03b033 100644
--- a/defines.h
+++ b/defines.h
@@ -942,8 +942,8 @@ struct winsize {
#if defined(VARIABLE_LENGTH_ARRAYS) && defined(VARIABLE_DECLARATION_AFTER_CODE)
# define USE_SNTRUP761X25519 1
#endif
-/* The ML-KEM768 imlementation similarly uses named struct initialisers */
-#ifdef NAMED_STRUCT_INITIALISERS
+/* The ML-KEM768 imlementation similarly uses C99 compound literals */
+#ifdef COMPOUND_LITERALS
# 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