From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89655 invoked by alias); 16 Nov 2015 16:35:49 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 89646 invoked by uid 89); 16 Nov 2015 16:35:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (146.101.78.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Nov 2015 16:35:47 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-37-EF4we5-8R5yw9Ha4xWNc1g-1; Mon, 16 Nov 2015 16:35:41 +0000 Received: from [10.2.206.40] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 16 Nov 2015 16:35:40 +0000 Message-ID: <564A05D8.4060103@arm.com> Date: Mon, 16 Nov 2015 16:35:00 -0000 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Bernd Schmidt , gcc-patches@gcc.gnu.org CC: "H.J. Lu" , Rich Felker Subject: Re: [PATCH, x86] Fix posix_memalign declaration in mm_malloc.h References: <564619AE.4020108@arm.com> <56464EF6.70302@redhat.com> <5649DD40.3030606@redhat.com> In-Reply-To: <5649DD40.3030606@redhat.com> X-MC-Unique: EF4we5-8R5yw9Ha4xWNc1g-1 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg01974.txt.bz2 On 16/11/15 13:42, Bernd Schmidt wrote: > On 11/13/2015 11:30 PM, Marc Glisse wrote: >>>> +__asm__("posix_memalign"); >>> >>> Can't say I like the __asm__ after the #if/#else/#endif block. >> >> It might also cause trouble if some systems like to prepend an >> underscore, maybe? > > Yeah, that's one of the things I had in mind when I suggested moving this= code to libgcc.a instead. Referring > to a library symbol in this way makes me nervous. > an alternative is to leave posix_memalign declaration there for c as is, but remove it for c++. (the namespace issue i think is mostly relevant for c and even there it should not cause problems in practice, g++ defines _GNU_SOURCE so stdlib.h does not provide a clean namespace anyway. but the incompatible exception specifier can easily break in c++ with -pedantic-errors, and removing the declaration should work in practice because _GNU_SOURCE makes posix_memalign visible in stdlib.h.)