Re: [Rd] R Include File Guards

From: Prof Brian Ripley <>
Date: Fri 17 Jun 2005 - 11:50:54 GMT

What is the `bug' here which you suggest reporting?

We have already established that leading underscores are NOT `illegal', just reserved and possibly ineffective according to the C99 standard (although we don't have any evidence of that being followed by an actual compiler). Given that the system includes on all three of my OSes use guards with leading underscores, they were VERY unlikely to be `illegal' as you stated. (Looking in /usr/local/include shows that they are very widely used in other projects.)

Is there any known platform on which there is a consequential problem? If not (and we have no evidence), we do not play around with non-bugs in patch releases.

Some adjustments have been made in the development version of R. BTW: not all files in R_ext are part of the API: however GraphicsDevice.h and GraphicsEngine.h are and they are now compatible with C++ and have guards.

On Wed, 15 Jun 2005, Paul Roebuck wrote:

> On Wed, 18 May 2005, Peter Dalgaard wrote:
>> Paul Roebuck <> writes:
>>> R 2.1.0/src/include from 2005/04/18 download
>>> Naming inconsistent for guards as well but that's pedantic.
>>> Simple convention:
>>> file <foo.h>
>>> #ifndef R_FOO_H
>>> file <R_ext/bar.h>
>>> #ifndef R_EXT_BAR_H
>>> Missing guards:
>>> <IOStuff.h>
>>> <Internal.h>
>>> <Parse.h>
>>> <R_ext/GraphicsBase.h>
>>> <R_ext/GraphicsDevice.h>
>>> <R_ext/GraphicsEngine.h>
>>> <R_ext/R-ftp-http.h>
>>> <R_ext/libextern.h>
>>> Illegal Guards (leading underscore):
>>> <Rinternals.h>
>>> <R_ext/Error.h>
>>> <>
>> Thanks. The ones outside R_ext, except Rinternals.h, are not part of
>> API, so it is not a bug that there are no guards - could still be a
>> good idea to have them of course. libextern.h explicitly says that you
>> shouldn't disallow including it more than once. So the ones with real
>> problems would be
>> <R_ext/GraphicsBase.h>
>> <R_ext/GraphicsDevice.h>
>> <R_ext/GraphicsEngine.h>
>> <R_ext/R-ftp-http.h>
>> <Rinternals.h>
>> <R_ext/Error.h>
>> What's illegal about leading underscores, BTW?
> I downloaded the R-patched for 2005/06/14 and noticed that
> the guards were never fixed. Should a bug report have been
> opened instead of simply noting them here?

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
Received on Fri Jun 17 22:09:52 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:09 GMT