[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] Changing the return type of done()

From: Josh Bressers
Subject: Re: [Nmh-workers] Changing the return type of done()
Date: Wed, 18 Apr 2007 07:55:03 -0400

> Well, that's an explanation strictly from the compiler's point of view,
> but since return in main() is the same as exit() the problem is really
> that done() is doing exit() precisely when it doesn't need to be done,
> because it'll be followed by a return from main().
> I've thought a bit more about this, and am now thinking of changing
> return done(status);
> to
> done(status);
> assert(0); /* done() shouldn't have returned */
> return 1;
> to emphasise that the return should not be reached. What do you think?
> Is this overkill?

It occurs to me that there is clear loss of goal here.  The problem is that
the compiler warnings annoy you, no?  They are of no significance with
respect to how nmh runs, and it's well known that the code needs help.

Would it not make more sense to fix the problem at its root rather than
creating a new one, and claiming that's OK since it's how it was done in
the past?

main() is not type void, it should return cleanly.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]