Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!umd5!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: Structure pointer question Message-ID: <8074@brl-smoke.ARPA> Date: 11 Jun 88 09:17:11 GMT References: <361@teletron.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 9 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? Technically not, because the "struct foo" type remains incomplete until 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. As you noticed, sometimes you can get away without doing it right.