From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Fkill_emacs NO_RETURN Date: Mon, 10 Apr 2006 06:27:55 +0300 Message-ID: References: <200604091913.k39JDaCI024303@scanner2.ics.uci.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1144639708 28680 80.91.229.2 (10 Apr 2006 03:28:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Apr 2006 03:28:28 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 10 05:28:25 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FSn4a-0005Dt-Aq for ged-emacs-devel@m.gmane.org; Mon, 10 Apr 2006 05:28:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FSn4Z-0004Nj-QP for ged-emacs-devel@m.gmane.org; Sun, 09 Apr 2006 23:28:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FSn4Q-0004Nd-HE for emacs-devel@gnu.org; Sun, 09 Apr 2006 23:28:06 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FSn4O-0004NO-1v for emacs-devel@gnu.org; Sun, 09 Apr 2006 23:28:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FSn4N-0004NL-SV for emacs-devel@gnu.org; Sun, 09 Apr 2006 23:28:03 -0400 Original-Received: from [192.114.186.20] (helo=nitzan.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FSn8w-0000en-44 for emacs-devel@gnu.org; Sun, 09 Apr 2006 23:32:46 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-228-135.inter.net.il [80.230.228.135]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id DBS03672 (AUTH halo1); Mon, 10 Apr 2006 06:27:52 +0300 (IDT) Original-To: Dan Nicolaescu In-reply-to: <200604091913.k39JDaCI024303@scanner2.ics.uci.edu> (message from Dan Nicolaescu on Sun, 09 Apr 2006 12:13:36 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52581 Archived-At: > Cc: emacs-devel@gnu.org > From: Dan Nicolaescu > 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.