This is the mail archive of the
mailing list for the GCC project.
Re: Fixed build failure on Linux in cppfiles (_XOPEN_SOURCEis evil)
>>>>> "Alexandre" == Alexandre Oliva <firstname.lastname@example.org> writes:
>> Defining these macros unconditionally on all systems is a
Alexandre> Agreed. I just approved the patch to get the tree in a
Alexandre> buildable state again, at least on GNU/Linux.
OK, I'm glad you agree.
Alexandre> I think we could leave the tree as is for the next
Alexandre> snapshot and see what breaks, then decide our next
In general, when we leave something be, we don't come back to it.
Maybe the way to go is to define _XOPEN_SOURCE conditionally and, if
it is defined, to decide whether to define _BSD_SOURCE and _GNU_SOURCE
I'm not sure I quite understand, but that sounds like it could be
I think there are two plausible strategies:
- Experimentally determine which of these macros are needed.
This is analagous to trying the inclusion of several different
header files hoping to get a declaration of some function foo,
where different systems put it in different header files.
- Notice that we are using glibc, or particular versions of glibc,
and turn on the defines there, since we know what they will do.
Otherwise, we're unconditionally defining macros that could have
affects we don't understand, and that we don't even have evidence will
Mark Mitchell email@example.com
CodeSourcery, LLC http://www.codesourcery.com