[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: Peter Maydell
Subject: Re: [Nmh-workers] Changing the return type of done()
Date: Tue, 17 Apr 2007 13:59:46 +0100

Joel Reicher wrote:
>>  #define NORETURN __attribute__ ((__noreturn__))
>>  #define NOTUSED __attribute__ ((__unused__))

>I have no problems with this, but I'll let you do it. I've already
>got all the changes I described in my working copy, and I'd prefer to
>commit them with no further changes, if I'm committing them at all.

Sure. Go ahead and commit them, it will save me trying to finish off
what I bet are essentially the same set of changes :-)

>> I'm tempted to suggest dumping the unreachable 'return 1;' lines too...
>I don't want to do this. The "return 1;" lines serve as a reminder that
>the code is awkward, and should be rewritten.

They're there because they're in a function returning int (ie main())
and the compiler doesn't know that done() never returns. If we gave
done() the noreturn attribute that would work. (Going to exit/atexit
would work too since exit is declared noreturn already.)

But I think in the long term atexit is probably better.

-- PMM

reply via email to

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