emacs-devel
[Top][All Lists]
Advanced

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

Re: Fkill_emacs NO_RETURN


From: Eli Zaretskii
Subject: Re: Fkill_emacs NO_RETURN
Date: Mon, 10 Apr 2006 06:27:55 +0300

> Cc: address@hidden
> From: Dan Nicolaescu <address@hidden>
> Date: Sun, 09 Apr 2006 12:13:36 -0700
> 
>   >       exit (INTEGERP (arg) ? XINT (arg) : EXIT_SUCCESS);
>   >       /* NOTREACHED */
>   >       return Qnil;
>   > 
>   > The ``NOTREACHED return'' is there because DEFUN declares a function
>   > that returns a Lisp_Object, and some compilers will complain if
>   > there's no return statement in such a function.
>   > 
>   > So either we find a clean way to condition `return Qnil' on NO_RETURN
>   > being defined to nothing, or we should revert this change.  
> 
> How about just deleting the return statement?

I thought I explained above why this was not a good idea.

> gcc has supported the noreturn attribute since at least gcc-2.95. 
> Other compilers might just warn if they don't realize that "exit" does
> not return. I think quite a few modern compilers know that.

You'd be surprised how many modern compilers whine about a non-void
function without a return statement.

>   > (Why was it made, anyway?)
> 
> One of the Coverity reports was due to the fact that the tool did not
> realize that Fkill_emacs cannot return. 
> 
> IMO marking the function as not returning will prevent having to
> analyze similar errors in the future with other checking tools.

That's fine with me, but the solution needs to be clean, and in
particular it shouldn't introduce new warning from GCC.




reply via email to

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