gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FreeBSD broken (gcc)


From: Richard Frith-Macdonald
Subject: Re: FreeBSD broken (gcc)
Date: Sat, 15 Oct 2011 15:07:06 +0100

On 15 Oct 2011, at 09:39, David Chisnall wrote:

> On 15 Oct 2011, at 06:12, Richard Frith-Macdonald wrote:
> 
>> It seems that some BSD systems have bugs in their handling of the  
>> _XOPEN_SOURCE macro (which is supposed to turn on certain POSIX and OPEN 
>> UNIX standard behaviors so we can depend on things like 
>> thread-safe/reentrant behaviors and consistent structure layouts in standard 
>> system libraries).  I turned that on to get reliable IPV6 data structure 
>> layouts and because Solaris (and presumably other systems) actually still 
>> uses non thead-safe errno by default, but it' s triggering this BSD bug on 
>> your systems.
> 
> Most UNIX systems use these macros to restrict the available APIs so that you 
> can be certain that you are not using any functions that are not present in 
> the spec.  If you are targeting POSIX systems, you turn on the POSIX macro 
> and no libc functions outside of POSIX are visible.

I don't think that's the case (on Solaris for example the macros enable 
standard behavior rather than turning off non-standard behavior) and for sure 
it's not what the standards themselves say.
These defines do not prohibit any extensions, they just make it mandatory that 
the system supplies the standard features.

> glibc, just to be different, uses them the opposite way and requires you to 
> specify them to enable features - it defaults to basically not being able to 
> compile any nontrivial C functions.

In this case glibc (and apparently everywhere else apart from a few BSD 
variants) is conforming to the standards  ... and at least in the NetBSD case 
this is clearly simply a bug: http://gnats.netbsd.org/37734





reply via email to

[Prev in Thread] Current Thread [Next in Thread]