When do you #include <stdlib.h>?

Steve Harrold swh at hpsmtc1.HP.COM
Tue Mar 29 02:07:45 AEST 1988


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.



More information about the Comp.lang.c mailing list