From simon.urbanek at r-project.org  Mon Jan  8 21:07:24 2007
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Mon, 8 Jan 2007 15:07:24 -0500
Subject: [Rd] can't compile on OSX: unsetenv header issues
In-Reply-To: <Pine.LNX.4.64.0701081740560.319@gannet.stats.ox.ac.uk>
References: <m23b6lfr95.fsf@fhcrc.org>
	<Pine.LNX.4.64.0701081740560.319@gannet.stats.ox.ac.uk>
Message-ID: <6B1C87E2-8971-4D40-A143-089C7E030758@r-project.org>


On Jan 8, 2007, at 12:47 PM, Prof Brian Ripley wrote:

> On Mon, 8 Jan 2007, Seth Falcon wrote:
>
>> Hi,
>>
>> A recent change has R failing to compile (for me) on ppc OSX  
>> 10.4.8 like this:
>>
>> ../../../../R-devel/src/main/datetime.c: In function `reset_tz':
>> ../../../../R-devel/src/main/datetime.c:511: error: void value not  
>> ignored as it ought to be
>>
>> I suspect there is some sort of configure magic that needs to happen
>> to get the POSIX compatible unsetenv on OSX.  Here's what I think is
>> the relevant bit from stdlib.h, but I'm hoping someone with more OSX
>> experience will recognize what needs to be done.
>
> So do I, but does defining __DARWIN_UNIX03 at the head of that file  
> (and sysutils.c) solve this?
>

I wouldn't set that one - it is used internally only. Instead, we  
should consider using _POSIX_C_SOURCE if we really want true POSIX  
compatibility. However, that is bound to affect all POSIX platforms,  
so I'm wondering if we are ready for that.
For the record, defining any of _APPLE_C_SOURCE, _XOPEN_SOURCE or  
_POSIX_C_SOURCE has the side-effect of enabling __DARWIN_UNIX03 on OS  
X, so _APPLE_C_SOURCE is an alternative if we want to restrict this  
to OS X only (it has the same effect, though).

Cheers,
Simon


> OSes who adopt pretty standard function names with non-standard
> implementations used to be commonplace, but I had rather hoped we  
> had seen
> the last of this after Single Unix Standard, POSIX ....
>
>
>> #if __DARWIN_UNIX03
>> int      unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
>> #else /* !__DARWIN_UNIX03 */
>> void     unsetenv(const char *);
>> #endif /* __DARWIN_UNIX03 */
>>
>>
>> + seth
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
> -- 
> Brian D. Ripley,                  ripley at stats.ox.ac.uk
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford,             Tel:  +44 1865 272861 (self)
> 1 South Parks Road,                     +44 1865 272866 (PA)
> Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>



[Rd] can't compile on OSX: unsetenv header issues
Simon Urbanek