http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46650
--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2010-11-25 02:03:29 UTC --- On Thu, 25 Nov 2010, howarth at nitro dot med.uc.edu wrote: > In file included from > /usr/include/c++/4.2.1/i686-apple-darwin10/x86_64/bits/c++locale.h:48, > from /usr/include/c++/4.2.1/iosfwd:45, > from /sw/include/gmp.h:24, > from ../../gcc-4.6-20101124/gcc/double-int.h:24, > from ../../gcc-4.6-20101124/gcc/tree.h:31, > from ../../gcc-4.6-20101124/gcc/c-family/stub-objc.c:26: > /usr/include/c++/4.2.1/cstring:75:8: error: attempt to use poisoned "strerror" > /usr/include/c++/4.2.1/cstring:95:11: error: attempt to use poisoned > "strerror" Given that including gmp.h itself in system.h is probably a bad idea (might cause unwanted libgmp library dependencies for executables that otherwise don't need it), my inclination is to include just the problem <cstring> header from system.h. That is: #ifdef __cplusplus #include <cstring> #else /* Existing code including <string.h> or <strings.h>. */ #endif I think it's reasonable for system.h to include C++ system headers when building as C++, and in general for it to use the C++ versions of C headers that have standard C++ versions (but hopefully it only needs to do so right now for <cstring>).