From ripley at stats.ox.ac.uk  Wed Mar 21 14:51:56 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Wed, 21 Mar 2007 13:51:56 +0000 (GMT)
Subject: [Rd] -std=c99 and inline semantics
In-Reply-To: <Pine.LNX.4.64.0703200826390.3114@auk.stats>
References: <45FEF6C5.1070900@santafe.edu>
	<Pine.LNX.4.64.0703200826390.3114@auk.stats>
Message-ID: <Pine.LNX.4.64.0703211325250.30424@gannet.stats.ox.ac.uk>

The answer seems to be simple: add -fgnu89-inline, which will be available 
for gcc >= 4.1.3 (not yet released) according to the info files in the 
trunk.

BTW, the two OSes I tried the GCC trunk on (FC5 and MinGW) both had 
problems of their own with this change of semantics.  AFAICS, wchar.h in 
glibc 2.5 (the latest release) still does.  This is going to make for 
interesting times when you can choose on a per-compilation-unit (and not 
per-header) basis what the 'inline' semantics should be.

On Tue, 20 Mar 2007, Prof Brian Ripley wrote:

> As even 4.2.0 is not released yet, we will make changes at an appropriate
> time.  The GNU and C99 semantics for 'inline' are known to be
> incompatible.
>
>> From src/include/Rinlinedfuns.h:
>
> /* this header is always to be included from others.
>    It is only called if COMPILING_R is defined (in util.c) or
>    from GNU C systems.
>
>    There are different conventions for inlining across compilation units.
>    We pro tem only use the GCC one.  See
>    http://www.greenend.org.uk/rjk/2003/03/inline.html
> */
>
> and note the 'pro tem'.
>
> On Mon, 19 Mar 2007, Marcus G. Daniels wrote:
>
>> Hi,
>>
>> I noticed that with the GCC trunk (4.3.0), the semantics of "extern
>> inline" have reversed.
>> The net result is that R will build without the usual-stdc=gnu99 but it
>> won't with it.
>> Many multiple definitions result otherwise.

-- 
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



[Rd] -std=c99 and inline semantics
Prof Brian Ripley