Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!dogie.macc.wisc.edu!indri!larry!jwp From: jwp@larry.sal.wisc.edu (Jeffrey W Percival) Newsgroups: comp.lang.c Subject: Re: declarations in include files: how do YOU feel? Keywords: declarations include Message-ID: <181@larry.sal.wisc.edu> Date: 12 May 89 00:08:34 GMT References: <179@larry.sal.wisc.edu> <10251@smoke.BRL.MIL> Reply-To: jwp@larry.sal.wisc.edu.UUCP (Jeffrey W Percival) Organization: Space Astronomy Lab, Madison, WI Lines: 20 In article <10251@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <179@larry.sal.wisc.edu> jwp@larry.sal.wisc.edu (Jeffrey W Percival) writes: >>Should the lib.h file contain extern declarations for everything in lib.a? >Otherwise, define/declare them all in lib.h. If functions in lib.a >can call other functions in lib.a, the user has to be aware of the >total set of external names defined by the library anyway so that he >doesn't accidentally usurp one for his application. (That would break >functions that called that usurped function.) This appears to be the consensus, and it makes sense. Thanks. And besides, I think I thought up another reason: what if the maintainer of the lib.a decides to re-implement an existing function as a macro, for example. If the user has the thing appearing in an extern statement, it might break. If the user relies on the lib.h file to "make everything OK", then the macro/function sleight of hand can proceed behind the scenes. Is that interpretation unflawed? -- Jeff Percival (jwp@larry.sal.wisc.edu)