C Style
Doug Gwyn
gwyn at smoke.BRL.MIL
Thu Jan 12 15:21:28 AEST 1989
In article <2700 at ficc.uu.net> peter at ficc.uu.net (Peter da Silva) writes:
-In article <9336 at smoke.BRL.MIL>, gwyn at smoke.BRL.MIL (Doug Gwyn ) writes:
-> In fact there is no need to place conditionals around those inclusions,
-> since the included file will have no effect if it is already in force,
-> bacause it checks its one-time lockout flag and avoids redefining things
-> after the first time it's included in a translation unit.
-Depends on the number of open files the operating system and 'C' library
-allows, and on the cost of opening a file. If the files are large, this
-extra set of conditionals might significantly enhance compilation speed.
Well, a good reason for nonetheless letting the compiler take care of it
for you is that otherwise the user of the header needs to also know the
special lock symbol for the header. General design principles argue that
the symbol should be the private property of the header.
More information about the Comp.lang.c
mailing list