
27 Jun
2011
27 Jun
'11
11:27 p.m.
On 6/27/2011 6:01 PM, Kim Barrett wrote:
On Jun 27, 2011, at 5:03 PM, Lars Viklund wrote:
On Mon, Jun 27, 2011 at 04:42:43PM -0400, Edward Diener wrote:
I doubt if any compiler cares where the #ifndef ( or #if !defined ) is.
I would reckon that compilers and preprocessor implementations may have fast-paths that they go into if they detect something that looks like an include guard very early in the file, where they can cheaply reject it if already included with a minimum of work, if they guarantee correctness.
After, all, it's a very common operation, it's most probably very beneficial for cutting preprocessing costs.
http://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html
I stand corrected.