tech-userlevel archive

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

Re: Adding <alloca.h> ?

Le jeu. 13 mai 2021 à 21:44, Joerg Sonnenberger <> a écrit :
> > No we don't, unless you are using PCC :D
> >
> > The block in <stdlib.h> only provides an alloca(3) prototype, and only
> > if the compiler already #defines alloca as __builtin_alloca.
> >
> > While this works for gcc in some -std modes (e.g. gnu++14), it does
> > not in others (c++14, c++11).
> Your analysis is wrong. We don't provide a prototype in standard modes
> as that violates the user request. The prototype is enough to trigger
> the builtin logic in GCC and Clang.


Anyway, would it be wrong to add <alloca.h> which unconditionally
makes alloca() use the builtin, similar to what e.g. glibc (Linux) and
FreeBSD do, or is it fundamentally wrong doing so?


Home | Main Index | Thread Index | Old Index