[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 21:33:43 +1000

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


        - Joel

reply via email to

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