Path: utzoo!attcan!sobmips!alawrenc From: alawrenc@sobeco.com (a.lawrence) Newsgroups: comp.lang.c Subject: Re: turbo-C and lint ? Message-ID: <1990Mar24.123304.12510@sobeco.com> Date: 24 Mar 90 12:33:04 GMT References: <1964@bruce.OZ> Organization: Sobeco Group - Montreal, Canada Lines: 39 From article <1964@bruce.OZ>, by alanf@bruce.OZ (Alan Grant Finlay): > I was surprised to discover that the Turbo-C package does not come with a lint > program. Specifically I want to have the ability to automatically check for > procedure argument type consistency. When in the past I have complained to > C advocates that C compilers don't check for consistent use of parameters they > have usually replied "that's what lint is for!". Is it really acceptable for > a commercial compiler package to come supplied without an essential part or > have I missed something in the package that does the same job? I think you had better take a second look at your compiler. If you turn on all the warning levels, it will do a much better job verifying your code than most lint programs. Turbo C has often found serious problems in programs which compiled and linted corrected on UNIX. As far as function definitions go, if you use ANSI style function prototypes Turbo C which check all of you function calls very closely, and even report a warning when the code you right is acceptable C but probably not what you wanted (suspicious pointer casts, etc). If you want the code you are developing to be portable to non-ANSI compilers use the following macro: #ifdef ansi_style #define P(x) x #else #define P(x) () #endif and code your function prototype as: char *function P((int num, har *string)); --- On a clear disk you can seek forever. ------------------------------------------------------------------------- Andrew Lawrence | alawrenc@sobmips.sobeco.UUCP Informaticien Conseil | {attcan,mcgill-vision}!sobeco!sobmips!alawrenc 3462 Jeanne-Mance, #1 | Montreal, Que CANADA | Voice (514) 281-5196