I need to create ANSI C function prototypes.

Michael Herman michael at orcisi.UUCP
Sun Feb 14 03:34:35 AEST 1988


> Take the lint shell file.  Make a copy.  Modify it so that it saves
> the output of the "lint1" pass.  Delete the lint2 pass.  Run it on
> the sources you want to have lint libraries for.  Viola!  The stuff
> you saved is the lint library.  Only one idiosyncrasy: if any of the
> library routines have lint errors, you'll see these lint errors on
> every invocation lint you use these new lint libraries on.  And, I
> expect that the libraries would be bigger than they could be.

As I remember, this would work for simple/basic types but fails for
typedefs and structs because the lint parser (usually the same code
used in the C compiler) doesn't keep the typedef names around.  To
compound matters, lint1 passes the length of structs and not their
names.  You have to internally modify lint1 and lint2 to pass the
actual names.

The easiest way of checking all this out is to turn on lint's internal
debug option (-m or -d or -z or somesuch).  This will give you a very
good idea of what lint is really (not) doing.

Under MS-DOS, the MS C compiler has a -Zg option which writes the prototypes
of the supplied source file to stdout.



More information about the Comp.unix.questions mailing list