This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, x86] Fix posix_memalign declaration in mm_malloc.h


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]