tech-userlevel archive

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

Re: Adding <alloca.h> ?

Le mer. 12 mai 2021 à 13:50, Joerg Sonnenberger <> a écrit :
> On Wed, May 12, 2021 at 08:38:39AM +0200, Jaromír Doleček wrote:
> > would it be a bad thing to add a compatibility <alloca.h> which would
> > use the builtin alloca() instead of the libc one when available?
> >
> > e.g. MySQL 8.0.* seems to rely on this.
> We provide it in stdlib.h as long as a standard mode is not set.
> I don't see the point of adding alloca.h.

We don't provide the builtin in stdlib.h.

The definition in stdlib.h makes the app use the libc-provided
alloca(), which is even more broken than using the builtin, and it
generates link-time warnings.

Le mer. 12 mai 2021 à 15:06, Niclas Rosenvik <> a écrit :
> MySQL 8.0.* reports problems because they compile without extensions
> using -std=c++14 , if they used -std=gnu++14 it would work.
> Or the could use SET(CMAKE_CXX_STANDARD 14) and
> cmake/build_configurations/compiler_options.cmake in the source tree.

OK, I can check if using gnu++14 would make the code use builtin for
alloca(). Does -std=gnu++14 work with clang?


Home | Main Index | Thread Index | Old Index