bug-gnulib
[Top][All Lists]
Advanced

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

Re: improve clang support (6)


From: Bruno Haible
Subject: Re: improve clang support (6)
Date: Fri, 07 Aug 2020 14:59:29 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-186-generic; KDE/5.18.0; x86_64; ; )

> 2020-08-07  Bruno Haible  <bruno@clisp.org>
> 
>       Use __builtin_alloca with clang.
>       * lib/alloca.in.h (alloca): Define as __builtin_alloca on clang.

This goes with it:


2020-08-07  Bruno Haible  <bruno@clisp.org>

        alloca: No need to compile alloca.c with clang.
        * lib/alloca.c: Skip all code with clang.

diff --git a/lib/alloca.c b/lib/alloca.c
index cdaf466..91b9ec3 100644
--- a/lib/alloca.c
+++ b/lib/alloca.c
@@ -39,8 +39,8 @@
 # define memory_full() abort ()
 #endif
 
-/* If compiling with GCC 2, this file's not needed.  */
-#if !defined (__GNUC__) || __GNUC__ < 2
+/* If compiling with GCC or clang, this file is not needed.  */
+#if !(defined __GNUC__ || defined __clang__)
 
 /* If someone has defined alloca as a macro,
    there must be some other way alloca is supposed to work.  */
@@ -197,4 +197,4 @@ alloca (size_t size)
 }
 
 # endif /* no alloca */
-#endif /* not GCC 2 */
+#endif /* not GCC || clang */




reply via email to

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