This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, x86] Fix posix_memalign declaration in mm_malloc.h
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Rich Felker <dalias at libc dot org>
- Date: Mon, 16 Nov 2015 16:35:36 +0000
- Subject: Re: [PATCH, x86] Fix posix_memalign declaration in mm_malloc.h
- Authentication-results: sourceware.org; auth=none
- References: <564619AE dot 4020108 at arm dot com> <56464EF6 dot 70302 at redhat dot com> <alpine dot DEB dot 2 dot 20 dot 1511132303160 dot 2106 at laptop-mg dot saclay dot inria dot fr> <5649DD40 dot 3030606 at redhat dot com>
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.)