From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: [PATCH] Unconditonally define alloca as __builtin_alloca
Date: Tue, 19 Nov 2019 10:28:57 +0100 [thread overview]
Message-ID: <20191119092856.GM25646@port70.net> (raw)
In-Reply-To: <20191119040459.11143-1-mforney@mforney.org>
* Michael Forney <mforney@mforney.org> [2019-11-18 20:04:59 -0800]:
> This enables alternative compilers, which may not define __GNUC__,
> to implement alloca, which is still fairly widely used.
>
> This is similar to how stdarg.h already works in musl; compilers must
> implement __builtin_va_arg, there is no fallback definition.
> ---
> include/alloca.h | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/include/alloca.h b/include/alloca.h
> index d2e6f1c6..8ae8a30d 100644
> --- a/include/alloca.h
> +++ b/include/alloca.h
> @@ -8,11 +8,7 @@ extern "C" {
> #define __NEED_size_t
> #include <bits/alltypes.h>
>
> -void *alloca(size_t);
i don't think removing the prototype is a good idea.
alloca is a builtin in gcc and won't generate an extern
call even without optimization, so things work now with
#undef alloca
> -
> -#ifdef __GNUC__
> #define alloca __builtin_alloca
> -#endif
>
> #ifdef __cplusplus
> }
> --
> 2.20.1
next prev parent reply other threads:[~2019-11-19 9:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-19 4:04 Michael Forney
2019-11-19 9:28 ` Szabolcs Nagy [this message]
2019-11-19 9:56 ` [PATCH v2] " Michael Forney
2020-01-01 20:02 ` Michael Forney
2020-01-01 20:08 ` Rich Felker
2020-01-01 20:28 ` Michael Forney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191119092856.GM25646@port70.net \
--to=nsz@port70.net \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).