nmh-workers
[Top][All Lists]
Advanced

[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: Tue, 17 Apr 2007 19:05:30 +1000

> I'd also be in favour of putting this in h/prototypes.h:
>  /* If this is GCC, we can specify some attributes to help the compiler
>   * (a) generate better code and (b) avoid spurious warnings.
>   * If this isn't GCC, the attributes are ignored.
>   */
>  #ifdef __GNUC__
>  #define NORETURN __attribute__ ((__noreturn__))
>  #define NOTUSED __attribute__ ((__unused__))
>  #else
>  #define NORETURN
>  #define NOTUSED
>  #endif
> 
> and then having the prototype for done() (and adios() too) look like
>  void done (int) NORETURN;

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.

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

> (Returning void also has the advantage that create_folder()'s second
> argument can be given the right type.)

That's what put me on to this. :) It seems that done() is supposed
to be like exit(), which is why it should probably be superseded by
atexit() registration.

Cheers,

        - Joel




reply via email to

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