Path: utzoo!mnetor!uunet!husc6!mailrus!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpcupt1!hpcuhb!hpsmtc1!swh From: swh@hpsmtc1.HP.COM (Steve Harrold) Newsgroups: comp.lang.c Subject: Re: When do you #include ? Message-ID: <11480011@hpsmtc1.HP.COM> Date: 28 Mar 88 16:07:45 GMT References: <4991@sigi.Colorado.EDU> Organization: Hewlett Packard, Cupertino Lines: 15 Re: When to #include anything Does anyone have knowledge of, or even better, code to share, that will scan a C source file, determine all the function calls embedded within it, and produce as output a list of files that should be included? This would simplify greatly the task of getting the minimal set of includes needed to make good use of the ANSI function prototyping capability. An additional output that would be useful is to print a list of the order the functions in the file should be placed, so that they are defined before their first use in the file. Once again, the purpose is give the compiler prototyping information. I know I can do this by trial and error (by letting the compiler trip on mismatches if I get something wrong), but a tool would be so much cleaner.