declarations in include files: how do YOU feel?

Henry Spencer henry at utzoo.uucp
Fri May 12 06:15:46 AEST 1989


In article <179 at larry.sal.wisc.edu> jwp at larry.sal.wisc.edu (Jeffrey W Percival) writes:
>The situation is, suppose I have a bunch of routines that are packaged
>into a lib.a, and there is an associated include file "lib.h" that
>users need to include.  Should the lib.h file contain extern declarations
>for everything in lib.a, or not?

Yes.  It's more convenient to the user to have all the declarations gotten
right for him (especially significant when ANSI prototypes become common)
than to have to do them himself, even though this theoretically allows him
to conserve name space.  Having to type such things in yourself almost
invariably leads to shortcuts and sloppiness, too.
-- 
Mars in 1980s:  USSR, 2 tries, |     Henry Spencer at U of Toronto Zoology
2 failures; USA, 0 tries.      | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list