]> Savannah Git Hosting - gnulib.git/commitdiff
Use flexible array syntax also on clang.
authorBruno Haible <bruno@clisp.org>
Tue, 11 Aug 2020 19:59:15 +0000 (21:59 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 11 Aug 2020 19:59:15 +0000 (21:59 +0200)
* lib/cdefs.h (__flexarr, __glibc_c99_flexarr_available): For clang,
define like for GCC 3.

ChangeLog
lib/cdefs.h

index a19ee8b59c3c4c334ae3b9e0c31d4c36bca13a7a..aced45e791d908106a808284d19b00686bf90249 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-08-11  Bruno Haible  <bruno@clisp.org>
+
+       Use flexible array syntax also on clang.
+       * lib/cdefs.h (__flexarr, __glibc_c99_flexarr_available): For clang,
+       define like for GCC 3.
+
 2020-08-11  Bruno Haible  <bruno@clisp.org>
 
        fcntl: On native Windows, use _setmode, not setmode.
index 00652549d78d97cd3dedd8959dd9cbb527a1dd20..4086d51b28a3158d105e7f82c5be98ad8a90929d 100644 (file)
 #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
 # define __flexarr     []
 # define __glibc_c99_flexarr_available 1
-#elif __GNUC_PREREQ (2,97)
-/* GCC 2.97 supports C99 flexible array members as an extension,
+#elif __GNUC_PREREQ (2,97) || defined __clang__
+/* GCC 2.97 and clang support C99 flexible array members as an extension,
    even when in C89 mode or compiling C++ (any version).  */
 # define __flexarr     []
 # define __glibc_c99_flexarr_available 1