nmh-workers
[Top] [All Lists]

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

2007-04-19 04:34:42
I think we shouldn't do that unless we're also going for atexit()
usage where we currently have specialised done() implementations.
(Surely there's going to be at least one file where the source code
calls done() and which done() it winds up calling depends on which
program it's compiled into...)

You're probably right, but I think I can still take this into account.

I can temporarily link everything with done.o, and the linker will
pick up the duplicate definition of done() in the cases where an
executable is actually using a specialised version.

I've just realised this doesn't really help. For example, adios() calls
done(), so if I were to remove the generic done() from libmh.a I'd have
to duplicate it in nearly every nmh command.

So perhaps there's no halfway measure; either we go with what's been
discussed before, i.e. the simple return type change and the cosmetic
changes to clarify that done() doesn't return, or we move to atexit().

A quick scan of the code reveals very little use of exit(), so I think
done() is used almost everywhere. Consequently, removing exit() from
all done() definitions and registering done() with atexit() at the
start of every main() would be equivalent to what we now have, as far
as I can tell.

I think I'll start working on this conversion to see how it turns out.
Let me know if I've missed anything.

Cheers,

        - Joel


_______________________________________________
Nmh-workers mailing list
Nmh-workers@nongnu.org
http://lists.nongnu.org/mailman/listinfo/nmh-workers

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