From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14943 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Michael Forney Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH v2] Unconditonally define alloca as __builtin_alloca Date: Tue, 19 Nov 2019 01:56:34 -0800 Message-ID: <20191119095634.24434-1-mforney@mforney.org> References: <20191119092856.GM25646@port70.net> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="142217"; mail-complaints-to="usenet@blaine.gmane.org" To: musl@lists.openwall.com Original-X-From: musl-return-14959-gllmg-musl=m.gmane.org@lists.openwall.com Tue Nov 19 10:56:52 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1iX0Ff-000apR-5D for gllmg-musl@m.gmane.org; Tue, 19 Nov 2019 10:56:51 +0100 Original-Received: (qmail 24567 invoked by uid 550); 19 Nov 2019 09:56:48 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 24535 invoked from network); 19 Nov 2019 09:56:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=mi7k8N9XeNhOqRxeeBwlTqiE6Mn1IhoTWicBy71lJFk=; b=ritHHLd86UEm4CKoqrS0Zstp6/oVMCfv8fooXOTY2Eq31vxKTk9H3Ql8uECAQ90Ck9 0mTK5DUQ2tfBAkvZ5LXL449QWFTpiCMGJov49mSEry2WamxmFIx2uvs5D1gY4GYRAuVO VmWKE2h5eaTnuDP7aUEsv+dNgdcmmJUKlp3OPjG36vnqQYIHpBJRaz4iXzuSnK9eI4bi 59sigdFyFak9ZNiaqVoDtzBND6KANKNjy5JhG0mooz9geWg8Ri9Xs9ZIOyGrhsoGYqiv chwfVAhsywElxtC+9lrG5FmomMtyUWL0uhTFFilXeVqUcudy8St13kEONMs+ocWqHoky ifgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mi7k8N9XeNhOqRxeeBwlTqiE6Mn1IhoTWicBy71lJFk=; b=svydEs+iVh7ugWYoZ3hUQGwAuYb+nPiS8OenBoOpFbKCb40FayFLcdog4P5YGfQNkd 0EnUb9Jf3WUJ5KLAr3Vb7Ayp0j3XM4rZoB6X3+JkF/ztD8aibCOMs8e63Uc0jjk8lFj0 et7XV9zD+FMyBQdLTbSEUVDiN8hL+n46f3p50LcDBXZZByMq7sS5VDEXqD33BeD6KV5g jw4FfNaWV45kdaY/5AHBA0OXbIu6rX4jwcfRP9PnnQ5200YEeNRVgNRdfNwrWkgJkRBG YTUCUuS5Y0H9syt2KMz5Po8vtVV4tcLuoMDy5OjdvKZJa5+Yifzimd1SBvINKpKOUPxk GWyA== X-Gm-Message-State: APjAAAVJwvHs4joAAB6HAFDG3oy+1zl6BdG+VdoFex4m+Sojk4DfDVTu qyjxr0jMETyBD6MRw3Z7dH0g5L7ieSI= X-Google-Smtp-Source: APXvYqweIWxCxn7xIx+IMp9/N6SF0pqZUM/AY7N8ds9ZqCHzYUjUn2KCxl9NG3o1vV8VTClWQ9kcRg== X-Received: by 2002:a63:e03:: with SMTP id d3mr4475692pgl.395.1574157395330; Tue, 19 Nov 2019 01:56:35 -0800 (PST) X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191119092856.GM25646@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:14943 Archived-At: 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 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