]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Stop using AC_C_FLEXIBLE_ARRAY_MEMBER, support for it is part of C99
authorOndřej Surý <ondrej@isc.org>
Thu, 28 May 2020 07:26:55 +0000 (09:26 +0200)
committerOndřej Surý <ondrej@isc.org>
Thu, 28 May 2020 09:28:44 +0000 (11:28 +0200)
config.h.win32
configure.ac
lib/dns/client.c
lib/isc/ht.c

index 44ebffec15df5ce64a6ed61c75c526f1c3e2e6c0..52c53ffc704cdea69e5a8244c77fe95a926c9af0 100644 (file)
@@ -375,17 +375,6 @@ typedef __int64 off_t;
 @HAVE_KRB5_H@
 @HAVE_KRB5_KRB5_H@
 
-/*
- * Define to nothing if C supports flexible array members, and to 1 if it does
- * not. That way, with a declaration like `struct s { int n; double
- * d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
- * compilers. When computing the size of such an object, don't use 'sizeof
- * (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
- * instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
- * MSVC and with C++ compilers.
- */
-#define FLEXIBLE_ARRAY_MEMBER /**/
-
 /* Avoid warnings with strlen() */
 #ifdef _WIN64
 #define strlen(x)      (unsigned int) strlen(x)
index 2a5a9b4c51437d79f3364e965557778c3a29c91c..a1787adf666f558ab66118059c4b582901781b40 100644 (file)
@@ -328,7 +328,6 @@ AX_TLS([AS_IF([test "$ac_cv_tls" != "thread_local"],
 AC_C_CONST
 AC_C_INLINE
 AC_C_VOLATILE
-AC_C_FLEXIBLE_ARRAY_MEMBER
 
 #
 # Check for yield support on ARM processors
index 7a68623ca2fe1168e2211e6ba2b78a4d2a6f565b..a86a5da468ec7d864fc01428c962d56e9eed4e36 100644 (file)
@@ -3061,7 +3061,7 @@ typedef struct {
        dns_rdata_t rdata;
        size_t size;
        isc_mem_t *mctx;
-       unsigned char data[FLEXIBLE_ARRAY_MEMBER];
+       unsigned char data[];
 } dns_client_updaterec_t;
 
 isc_result_t
index b3c9e5100da959a78f9274916ea327653bbf7d95..7bda1cf662f9bc988adaf9fe8eb0d4868c484396 100644 (file)
@@ -29,7 +29,7 @@ struct isc_ht_node {
        void *value;
        isc_ht_node_t *next;
        size_t keysize;
-       unsigned char key[FLEXIBLE_ARRAY_MEMBER];
+       unsigned char key[];
 };
 
 struct isc_ht {