Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191119095634.24434-1-mforney@mforney.org>
Date: Tue, 19 Nov 2019 01:56:34 -0800
From: Michael Forney <mforney@...rney.org>
To: musl@...ts.openwall.com
Subject: [PATCH v2] Unconditonally define alloca as __builtin_alloca

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.
---

On 2019-11-19, Szabolcs Nagy <nsz@...t70.net> wrote:
> 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

OK, added back in v2.

 include/alloca.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/alloca.h b/include/alloca.h
index d2e6f1c6..b8d183d1 100644
--- a/include/alloca.h
+++ b/include/alloca.h
@@ -10,9 +10,7 @@ extern "C" {
 
 void *alloca(size_t);
 
-#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.