This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
Re: Homogenizing include guards - and copyright comments
- From: "Max Bowsher" <maxb at ukf dot net>
- To: "Gary R. Van Sickle" <g dot r dot vansickle at worldnet dot att dot net>,<cygwin-apps at cygwin dot com>
- Date: Sat, 21 Jun 2003 00:25:58 +0100
- Subject: Re: Homogenizing include guards - and copyright comments
- References: <NCBBIHCHBLCMLBLOBONKKEGBEEAA.g.r.vansickle@worldnet.att.net>
Max Bowsher wrote:
>> I'm about to do the include guard cleanup I mentioned some time ago.
>>
>> Whilst I'm tidying up the names of the include guards, I might as well
tidy
>> up the locations of the include guards (with respect to the comments at
the
>> start of the file). Is this ordering OK? :
>>
>> -----------------------------------------
>> /*
>> * Copyright (c) .....
>> * .....
>> *
>> */
>>
>> #ifndef SETUP_FOOBAR_H
>> #define SETUP_FOOBAR_H
>>
>> /* (In some files) Brief description of file. */
>>
>> rest-of-file
>>
>> #endif /* SETUP_FOOBAR_H */
>> --------------------------------------------
Off-list (presumably accidentally), Gary R. Van Sickle replied:
> I tend to think that the include guards should wrap as much of the file as
> possible, idea being that the compiler then bypasses the most text
possible.
> But then again, rumor has it that gcc (at least) recognizes such
constructs and
> doesn't even rescan the file at all the second time, and scanning is
hardly the
> bottleneck in gcc these days....
I don't think the extra copyright comments will have much of an effect on
compilation speed. I like the layout I proposed, because it gives increased
visual distinction between copyright boilerplate and file-specific
interesting info.
Max.