bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

improve clang support (24)


From: Bruno Haible
Subject: improve clang support (24)
Date: Tue, 11 Aug 2020 21:59:54 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; )

clang also has the "flexible array" in struct extension, even on Windows.
(ac_cv_c_flexmember=yes.)


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.

diff --git a/lib/cdefs.h b/lib/cdefs.h
index 0065254..4086d51 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -167,8 +167,8 @@
 #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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]