nmh-workers
[Top] [All Lists]

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

2007-04-18 05:56:11

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.

-- 
    JB


_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>