Article View: comp.lang.misc
Article #6120Re: Yet Another Lint Foul-up
From: T. William Wells
Date: Sun, 08 Jan 1989 00:35
Date: Sun, 08 Jan 1989 00:35
31 lines
1973 bytes
1973 bytes
In article <1298@tank.uchicago.edu> vevea@paideia.UUCP (Jack L. Vevea) writes:
: I've passively watched the discussion of lint's problems with
: exit(0) from main(), and find myself wondering why it matters. I use
: lint to check my code, but I've gotten into the habit of automatically
: ignoring certain output, including 'warning: main() returns a random
: value to the invocation environment.' Being primarily a psychometrician,
: and not a professional C (or any other language) programmer, I find myself
: wondering if some of you out there are working under conditions in which
: some higher authority requires you to produce a clean lint run as
: evidence of good coding. Otherwise, it would seem to me that any
: concern with the message would be evidence of your being a slave to
: lint; why else be concerned when you _know_ that the warning is
: inconsequential?
Here are the two reasons why one deals with this:
1) Having put an exit() in the program, you should add
/*NOTREACHED*/ right after it; this tells lint that you know
what you are doing.
2) If you do 1), as you should, getting the lint message means you
screwed up: you didn't put an exit() or return where it
belongs.
In short, if you are in the habit of ignoring this particular message,
you should change your habit. Always do 1) and, should you get the
message, investigate and fix the problem.
---
Bill
{ uunet!proxftl | novavax } !twwells!bill
Technical Details
Message-ID:
<301@twwells.uucp>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!ukma!uflorida!novavax!twwells!billReferences:
<1298@tank.uchicago.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!ukma!uflorida!novavax!twwells!bill From: bill@twwells.uucp (T. William Wells) Newsgroups: comp.lang.misc,comp.lang.c,comp.lang.c++ Subject: Re: Yet Another Lint Foul-up Keywords: Idle curiosity. Message-ID: <301@twwells.uucp> Date: 8 Jan 89 00:35:52 GMT References: <1298@tank.uchicago.edu> Reply-To: bill@twwells.UUCP (T. William Wells) Organization: None, Ft. Lauderdale Lines: 31