Xref: utzoo comp.lang.c:24742 comp.lang.c++:5979 comp.std.c:2297 Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!haven!udel!rochester!quiroz From: quiroz@cs.rochester.edu (Cesar Quiroz) Newsgroups: comp.lang.c,comp.lang.c++,comp.std.c Subject: Re: So where is a lint for ANSI C code? Summary: Better error messages in single compilations are not enough Message-ID: <1989Dec27.035411.23602@cs.rochester.edu> Date: 27 Dec 89 03:54:11 GMT References: <16355@megaron.cs.arizona.edu> Reply-To: quiroz@cs.rochester.edu (Cesar Quiroz) Followup-To: comp.lang.c Organization: University of Rochester, Department of Computer Science Lines: 43 gumby@Gang-of-Four.Stanford.EDU (David Vinayak Wallace) wrote: | But GCC and G++ by themselves are pretty good; with -Wall I doubt you | need a special lint. Some of lint's finest moments come when one runs it on *several* C sources simultaneously. The usual style of Unix C compilation is to perform separate runs on each file for object code production, but just one lint run on the whole thing[1]. Admittedly, prototypes catch one of the more common reasons for having all the files visible at once (caller-callee disagreement). Still, a system-wide checker that is not also expected to generate code could prove useful. Anecdote: once I helped some people debug a program that had a weird case of def-def disagreement. I think it involved a program that declared the same structure in two files, altering the order of two of the fields. This was just poor coding, of course, but (1) none of the -c compiles saw anything bad, (2) dbx just went crazy on it. I recall that I insisted on a full-system lint and saw there the double, inconsistent, definition. This was under Sun OS x.y, where x was most likely something like 2). I tried reconstructing the case for posting not long ago, but I failed under Sun OS 4; perhaps someone more patient can produce an example based on the above information. Have a happy New Year! And let's hope we get a C standard this year. Cesar ( Why didn't they invent a trigraph to let me put an accent on that e? I thought the C committee was into character set standardization and transmission protocols too, right? :-) [1] Unbelievers don't run lint at all. Naive believers run lint on each file separately. None of these strategies is particularly persuasive, although both yield plenty of excitement during debugging. -- Cesar Augusto Quiroz Gonzalez Department of Computer Science University of Rochester Rochester, NY 14627