[Mingw-users] Trouble with alloca.h

Back to archive index
Eli Zaretskii eliz****@gnu*****
Mon Feb 18 12:31:47 JST 2019


> From: Keith Marshall <keith****@users*****>
> Date: Sun, 17 Feb 2019 23:25:16 +0000
> 
> > 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
> 
> So, yet another endemic Gnulib bug.
> 
> > I'm not yet sure why Gnulib decides that it needs to use its own
> > alloca.h,
> 
> It should not do so; it should defer to the host platform's own
> implementation, when one is provided.

https://lists.gnu.org/archive/html/bug-gnulib/2019-02/msg00032.html

> > Should MinGW's alloca.h perhaps be more defensive,
> 
> It could be, but...
> 
> > and only define its
> > own version if 'alloca' is not already defined as a macro?
> 
> this isn't the way; it should simply, and unilaterally, override the
> endemic brain damage in packages such as Gnulib, and just #undef any
> pre-existing, conflicting macro definition.

That should also work, but it might mean part of the offending package
is compiled with "the other" definition of alloca, which could cause
some subtle problem?

Thanks.



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