unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Fkill_emacs NO_RETURN
Date: Mon, 10 Apr 2006 06:27:55 +0300	[thread overview]
Message-ID: <u3bgm5cuc.fsf@gnu.org> (raw)
In-Reply-To: <200604091913.k39JDaCI024303@scanner2.ics.uci.edu> (message from Dan Nicolaescu on Sun, 09 Apr 2006 12:13:36 -0700)

> Cc: emacs-devel@gnu.org
> From: Dan Nicolaescu <dann@ics.uci.edu>
> 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	other threads:[~2006-04-10  3:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-09 18:40 Fkill_emacs NO_RETURN Eli Zaretskii
2006-04-09 19:13 ` Dan Nicolaescu
2006-04-10  3:27   ` Eli Zaretskii [this message]
2006-04-09 22:29 ` Richard Stallman
2006-04-10  6:40   ` Dan Nicolaescu
2006-04-10 18:25     ` Richard Stallman
2006-04-10 19:27       ` Dan Nicolaescu
2006-04-11  3:59         ` Richard Stallman
2006-04-10  0:35 ` Stefan Monnier
2006-04-10  3:33   ` Eli Zaretskii
2006-04-10  4:31     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=u3bgm5cuc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).