Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 06 Oct 1997 12:06:43 -0700
From:      Colin Jensen <cj@accom.com>
To:        Terry Lambert <tlambert@primenet.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Minor error (?) in regex.h
Message-ID:  <343936C3.794BDF32@accom.com>
References:  <199710052341.QAA24216@usr05.primenet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> > The stuff in /usr/include isn't meant to be standalone - it's a
> > hysterically religious thing.
> 
> Having to do with relative compilation times based on how the C
> preprocessor works.

If you mean that the preprocessor must read the file multiple times,
that's not a good reason.  The GNU preprocessor is smart enough
to notice if a header file is wrapped with #ifndef IDENT and will
avoid reading the header file the second time it is included if
IDENT is defined.

> The problem with making the cpp "know" the file to be included is
> already in scope is truly religious history: you can't be sure
> that some idiot trying to program C++ in C didn't define something,
> #include a file which ##'ed the something as a prefix/suffix, then
> redefined the thing, and included the same file again (think of
> "template classes for C" and you will get the -- nauseating -- picture).

I beleive GNU's cpp will handle this correctly:  Since a C Template
file will not be wrapped with an #ifndef, it will be read multiple
times as the programmer intended.

- Colin "Beleiver in Emacs and Stand-alone include files" Jensen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?343936C3.794BDF32>