Path: utzoo!attcan!uunet!vsi!sullivan From: sullivan@vsi.UUCP (Michael T Sullivan) Newsgroups: comp.lang.c Subject: Re: Structure pointer question Summary: #includes in .h files Message-ID: <718@vsi.UUCP> Date: 14 Jun 88 14:39:02 GMT References: <361@teletron.UUCP> <8074@brl-smoke.ARPA> Organization: V-Systems, Inc. -- Santa Ana, CA Lines: 18 In article <8074@brl-smoke.ARPA>, gwyn@brl-smoke.ARPA (Doug Gwyn ) writes: > In article <361@teletron.UUCP> andrew@teletron.UUCP (Andrew Scott) writes: > >Is it alright to #include "foo.h" and not "bar.h" in a source file if the > >fields of "struct bar" are not used? > > you declare a complete type for "struct bar". The easiest thing to do > is to have "foo.h" include "bar.h" right after the incomplete "struct foo" > declaration. Then the application doesn't have to worry about it. Which brings up a question: is it considered a good thing or a bad thing to have .h files #include'ing other .h files instead of having the .c files do it all. The rule around here is that there are to be no #include's in .h files we write. Mail me your opinions for or against. -- Michael Sullivan {uunet|attmail}!vsi!sullivan V-Systems, Inc. Santa Ana, CA sullivan@vsi.com HE V MTL <-That's my license plate, is yours any better?