This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Homogenizing include guards - and copyright comments


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]