From patchwork Mon Dec 19 22:26:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 707261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tjFrp0wqBz9t0H for ; Tue, 20 Dec 2016 09:26:46 +1100 (AEDT) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id B580E10101; Mon, 19 Dec 2016 23:26:40 +0100 (CET) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by helium.openadk.org (Postfix) with ESMTP id B5AB410100 for ; Mon, 19 Dec 2016 23:26:37 +0100 (CET) Received: by mail.free-electrons.com (Postfix, from userid 110) id CB6C22097F; Mon, 19 Dec 2016 23:26:37 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LFbn-1-6691-76.w90-120.abo.wanadoo.fr [90.120.129.76]) by mail.free-electrons.com (Postfix) with ESMTPSA id A04E720654; Mon, 19 Dec 2016 23:26:27 +0100 (CET) From: Thomas Petazzoni To: devel@uclibc-ng.org Date: Mon, 19 Dec 2016 23:26:23 +0100 Message-Id: <1482186383-28740-1-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.7.4 Subject: [uclibc-ng-devel] [PATCH] sys/cdefs.h: add definition of __attribute_alloc_size__ X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" Commit cee0b058fa0b4501b289a2da365182d60314d746 ("add aligned_alloc required for latest gcc libstdc++") added the prototype of aligned_alloc() to . This prototype contains '__attribute_alloc_size__ ((2))', but this is not defined anywhere in uClibc-ng. This commit addresses that by adding the relevant definition in , borrowed from glibc. Signed-off-by: Thomas Petazzoni --- include/sys/cdefs.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h index f725ce9..6cd3811 100644 --- a/include/sys/cdefs.h +++ b/include/sys/cdefs.h @@ -222,6 +222,15 @@ # define __attribute_malloc__ /* Ignore */ #endif +/* Tell the compiler which arguments to an allocation function + indicate the size of the allocation. */ +#if __GNUC_PREREQ (4, 3) +# define __attribute_alloc_size__(params) \ + __attribute__ ((__alloc_size__ params)) +#else +# define __attribute_alloc_size__(params) /* Ignore. */ +#endif + /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */