Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!samsung!munnari.oz.au!ditmela!yarra!monu6!minyos!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: Can lint help an ANSI-C programmer? Summary: yes it can Message-ID: <3118@goanna.cs.rmit.oz.au> Date: 31 May 90 11:25:42 GMT References: <6328.265D8157@puddle.fidonet.org> <1754@tkou02.enet.dec.com> <009377E6.C32DAB80@rigel.efd.lth.se> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 20 In article <00937758.16FBE220@rigel.efd.lth.se> e89hse@rigel.efd.lth.se writes: > I don't see what lint discovers that a C-compiler with prototypes can't >discover, except wrong external declarations like: hello[100], char *hello. Isn't that _enough_? How is an ANSI C compiler, with just one file to look at, going to notice that you've defined two functions with the same name in different files? Yes, the linker will catch that one, but the linker won't tell you which lines the definitions are on, and lint will. And if you have set up a lint-library file for a local library, lint can warn you about attempts to redefine a function in the local library (an ANSI C compiler should tell you about redefining standard library functions, but might not warn you about conflicts with X) even though a linker might _not_ warn you about multiple definitions. (As the UNIX linker would not; it won't pull a library entry in if the function is already defined.) -- "A 7th class of programs, correct in every way, is believed to exist by a few computer scientists. However, no example could be found to include here."