[Top][All Lists]

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

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

From: Joel Reicher
Subject: [Nmh-workers] Changing the return type of done()
Date: Tue, 17 Apr 2007 15:08:32 +1000

At the moment done() returns int, but it does this *only* because it is
used at the end of main()s as

return done (status);

Every definition of done() I've been able to find (it's overridden in
some compilation units) has the line

return 1;  /* dead code to satisfy the compiler */

at the end solely because of this calling context.

While it makes some sense to provide this dead code in main(), I believe
it is bad programming practice to hide it in a function that would not
otherwise contain it for any other reason.

I'd like to change done() to return void, and replace all the main()
calls with the two lines

return 1;

I write "return 1;" there only because it's entirely equivalent to what's
currently in the code. All the done() implementations call exit(), so
the line should never be reached.

After 1.3 I'd prefer to replace this use of done() with some atexit()
registration, but does anybody have comments about the change I'm
proposing for the moment?


        - Joel

reply via email to

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