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. Marcus
-std=c99 and inline semantics
3 messages · Marcus G. Daniels, Brian Ripley
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. Marcus
______________________________________________ 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
1 day later
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