[PATCH, GCC] Fix conflicting posix_memalign declaration error

Caroline Tice cmtice@google.com
Thu Oct 27 20:47:00 GMT 2016


The posix_memalign declaration in gcc/i386/config/pmm_malloc.h is
decorated with 'throw ()', which occasionally causes declaration
conflict errors (some header files, not part of GCC, that declare
posix_memalign, do not have the throw decoration).  An example of this
can be seen at https://github.com/android-ndk/ndk/issues/91.  It
appears that the 'throw()' decoration comes from glibc header files.
Adding ifdefs to check for __GLIBC__ before adding the 'throw()' fixed
the github problem mentioned above.

I have tested this patch by bootstrapping and by running test
testsuite with no regressions.

Is this ok to commit?

-- Caroline Tice
ctice42@gmail.com


gcc/ChangeLog:

2016-10-27  Caroline Tice  <cmtice@google.com>

        * config/i386/pmm_malloc.h (posix_memalign):  Add ifdefs to only
        decorate the declaration with 'throw()' if __GLIBC__ is defined.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-fsf.posix_memalign.patch
Type: text/x-patch
Size: 544 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161027/c0a47945/attachment.bin>


More information about the Gcc-patches mailing list