From rhurlin at gwdg.de  Sun Oct  3 19:03:25 2010
From: rhurlin at gwdg.de (Rainer Hurling)
Date: Sun, 03 Oct 2010 19:03:25 +0200
Subject: [Rd] R-beta_2010-10-02_r53128 fails to compile on FreeBSD
In-Reply-To: <4CA8B16D.901@gmail.com>
References: <4CA89209.4030005@gwdg.de>	<alpine.LFD.2.00.1010031607400.17992@gannet.stats.ox.ac.uk>	<4CA8A4F3.1050105@gwdg.de>
	<alpine.LFD.2.00.1010031654440.25405@gannet.stats.ox.ac.uk>
	<4CA8B16D.901@gmail.com>
Message-ID: <4CA8B75D.8040606@gwdg.de>

On 03.10.2010 18:38 (UTC+1), Peter Dalgaard wrote:
> On 10/03/2010 05:58 PM, Prof Brian Ripley wrote:
>> On Sun, 3 Oct 2010, Rainer Hurling wrote:
>>
>> ...
>>>>> Is this a known error? I would really appreciate if someone could give
>>>>> me a hint.
>>>>
>>>> Not known, and as it is a POSIX construction almost all OSes have it.
>>>
>>> Hmmm. It seems its implementation in FreeBSD (CURRENT) is a little different
>>> from other OSes?
>>>
>>>> Can you try (in sysutils.c and sys-unix.c) replacing
>>>>
>>>> #ifdef HAVE_SYS_WAIT_H
>>>>
>>>> by
>>>>
>>>> #if defined(HAVE_SYS_WAIT_H)&&  defined(WEXITSTATUS)
>>>>
>>>> ?
>>>
>>> Yes, with this patch in both files all works again. I tried it with gcc-4.4.5
>>> and gcc-4.5.2. Is there any chance to get it in the release (R-2.12.0)?
>>
>> Yes, of course.  (After a little more testing on other platforms.)
>>
>
> Only it strikes me that it might be plugging the wrong hole. I.e., that
> the real issue is that somehow we're not including sys/wait.h in all
> cases. Would it perchance also work to have
>
> #ifdef HAVE_SYS_WAIT_H
> #include<sys/wait.h>
> #endif

Just as a note. This (#include<sys/wait.h>) also works on FreeBSD.

Rainer Hurling


> somewhere at the top of the files that use the two macros (sysutils.c
> and sys-unix.c AFAICS).
>
> "&&  defined(WEXITSTATUS)" probably won't break anything that wasn't
> already broken, but it does insert a default definition that could
> conflict with the one intended for the OS (that's what include files and
> macros are for, after all).



[Rd] R-beta_2010-10-02_r53128 fails to compile on FreeBSD
Rainer Hurling