Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191119092856.GM25646@port70.net>
Date: Tue, 19 Nov 2019 10:28:57 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] Unconditonally define alloca as __builtin_alloca

* Michael Forney <mforney@...rney.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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.