clang supports __builtin_alloca. On Windows, it does not have an <alloca.h> header file, and therefore the use of alloca(...) without any header file produces a warning warning: implicitly declaring library function 'alloca' with type 'void *(unsigned long long)'
Therefore, the bestes choices for gnulib are - to use __builtin_alloca, or - to use _alloca from <malloc.h>. Both produce identical code. But I find it more convenient to use a compiler built-in rather than an MSVC header file. 2020-08-07 Bruno Haible <[email protected]> Use __builtin_alloca with clang. * lib/alloca.in.h (alloca): Define as __builtin_alloca on clang. diff --git a/lib/alloca.in.h b/lib/alloca.in.h index beb022c..8d9ae06 100644 --- a/lib/alloca.in.h +++ b/lib/alloca.in.h @@ -44,7 +44,7 @@ # endif #endif #ifndef alloca -# ifdef __GNUC__ +# if defined __GNUC__ || (__clang_major__ >= 4) # define alloca __builtin_alloca # elif defined _AIX # define alloca __alloca
