[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: Joel Reicher
Subject: Re: [Nmh-workers] Changing the return type of done()
Date: Thu, 19 Apr 2007 13:07:54 +1000

> It occurs to me that there is clear loss of goal here.  The problem is that
> the compiler warnings annoy you, no?

That's not entirely it; I take the compiler warnings as (one of many)
hints of what needs to be cleaned up, and my desire is for cleanup, not
the elimination of warnings simply for their own sake.

> They are of no significance with
> respect to how nmh runs, and it's well known that the code needs help.

And I'm trying to help the code; compiler complaints are just one place
to start.

> 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?

Yes, but I wasn't sure how attached people are to done(). I've heard
no comments made in its favour, so perhaps I can propose a different,
more genuine fix I have in mind.

What I'd really like to do is get rid of sbr/done.c and the done()
declaration in h/prototypes.h altogether, replacing uses of *that*
done() definition with an equivalent return where it appears in main(),
and a use of exit() everywhere else.

For the uses of done() that refer to different definitions, I'd like to
make it a static function in that translation unit. I'm also toying with
the idea of pulling the exit() call out of those specialised done()s
and placing them after the done() calls wherever they occur (if not even
further up the call stack), but I don't like the danger of someone writing
a call to a done() (or whatever) which is not followed by an exit().

Is that better?

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

I never said otherwise. I'm just trying to reconcile the typical writing
of main() with the way done() is currently employed in the code.


        - Joel

reply via email to

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