Subject: Re: missing #include ?
To: None <tech-userlevel@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 12/10/2006 20:27:44
>> "CPP optimizes even further. It remembers when a header file has a
>> wrapper `#ifndef'. If a subsequent `#include' specifies that
>> header, and the macro in the `#ifndef' is still defined, it does not
>> bother to rescan the file at all."
> I thought about that, since the preprocessor is the obvious place for
> an optimisation, and ISTR C++ does something similar with the #import
> statement. But I wasn't sure whether cutting corners like this would
> go down well with ANSI C. If it does, all the better.
Yes, this comes under the "as if" rule. The semantics are as if the
file were reread; gcc just remembers when the file is such that it can
be short-circuited this way without changing the semantics.
/~\ The ASCII der Mouse
\ / Ribbon Campaign
X Against HTML mouse@rodents.montreal.qc.ca
/ \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B