[Mingw-users] Trouble with alloca.h

Back to archive index
Eli Zaretskii eliz****@gnu*****
Mon Feb 18 02:17:45 JST 2019


The new header alloca.h defines 'alloca' unconditionally as (AFAIU) an
inline function:

  __CRT_ALIAS void *alloca( size_t __n ){ return __builtin_alloca( __n ); }

This caused me trouble while building a GNU package, because Gnulib's
alloca.h makes 'alloca' a macro:

  #ifndef alloca
  # ifdef __GNUC__
  #  define alloca __builtin_alloca

I'm not yet sure why Gnulib decides that it needs to use its own
alloca.h, but I know that many packages do the above regardless, when
the compiler is GCC.

Should MinGW's alloca.h perhaps be more defensive, and only define its
own version if 'alloca' is not already defined as a macro?



More information about the MinGW-Users mailing list
Back to archive index