Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!rutgers!att!cbnewsl!cbnewsk!pegasus!hansen From: hansen@pegasus.att.com (Tony L. Hansen) Newsgroups: comp.lang.c++ Subject: Re: Lint for C++ Summary: yes, there are some things a lint++ can do for us Keywords: C++, lint Message-ID: <1990Dec20.042841.16639@cbnewsk.att.com> Date: 20 Dec 90 04:28:41 GMT References: <93Rcu1w163w@turbo.atl.ga.us> Sender: hansen@cbnewsk.att.com (tony.l.hansen) Distribution: comp Organization: AT&T Bell Laboratories Lines: 25 < Isn't the C++, itself, enough of a LINT program?? LINT is usually used < to detect potential problems in the source code that the compiler would < not normally check for. C++, though, seems to check for everything < that a LINT program would, so what's the need? Off the top of my head, here are some of the things that a lint++ could do that C++ is incapable of doing: o check the types of the arguments to printf- and scanf-like functions o know about functions which never return o check for falling through switch cases o look for external symbols that could be declared static o find unused external variables These are all capabilities of the version of lint in System V release 4. Most capabilities cannot be folded into the C++ compiler. It might be possible to introduce some of them through language modifications. Others might possibly be introduced through #pragma's. But it's also unclear whether any of these SHOULD be caught by the compiler. So, yes, there is a need for a lint++. Tony Hansen att!pegasus!hansen, attmail!tony hansen@pegasus.att.com