From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Nonsensical byte compiler warning. Date: Wed, 04 Apr 2007 18:11:17 -0400 Message-ID: <87mz1ng58a.fsf@stupidchicken.com> References: <85ps6okoe5.fsf@lola.goethe.zz> <87lkhcj791.fsf@stupidchicken.com> <87tzvwvj6c.fsf@gmx.at> <861wj04qcq.fsf@lola.quinscape.zz> <873b3gpn4u.fsf@gmx.at> <20070404212752.GA2717@muc.de> <87ps6jq0dz.fsf@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1175724569 10314 80.91.229.12 (4 Apr 2007 22:09:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 4 Apr 2007 22:09:29 +0000 (UTC) Cc: Alan Mackenzie , rms@gnu.org, emacs-devel@gnu.org To: Markus Triska Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 05 00:09:24 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HZDfP-0001YN-Mz for ged-emacs-devel@m.gmane.org; Thu, 05 Apr 2007 00:09:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HZDii-0003De-0g for ged-emacs-devel@m.gmane.org; Wed, 04 Apr 2007 18:12:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HZDie-0003DZ-U7 for emacs-devel@gnu.org; Wed, 04 Apr 2007 18:12:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HZDid-0003DL-FO for emacs-devel@gnu.org; Wed, 04 Apr 2007 18:12:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HZDid-0003DI-A0 for emacs-devel@gnu.org; Wed, 04 Apr 2007 18:12:43 -0400 Original-Received: from cyd.mit.edu ([18.19.1.138]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HZDfI-0000dJ-Hg; Wed, 04 Apr 2007 18:09:16 -0400 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 25B364E3F2; Wed, 4 Apr 2007 18:11:17 -0400 (EDT) In-Reply-To: <87ps6jq0dz.fsf@gmx.at> (Markus Triska's message of "Wed\, 04 Apr 2007 23\:45\:44 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:69074 Archived-At: Markus Triska writes: > Alan Mackenzie writes: > >> Would it be easy to make this change to the byte compiler? > > Alas, no. The optimiser hasn't got the positioning information, and > the byte-code emitter potentially doesn't see such calls at all: > Conceptually, the optimiser is capable of totally removing unneeded > function calls (the code is there, and disabled). Conversely, the > positioning code is fragile enough already to warrant keeping it well > separated from the optimiser, and limited to the emitter. Now, since > unnecessary function calls are currently kept, detection logic from > the optimiser could be used in the emitter, but that would duplicate a > lot of code, is error-prone, and can, in my view, not yield more > useful results than byte-compiling with byte-optimize-log set to t. On > top of that, it would result in the same char-before/after confusion, > since that rewriting is performed by the optimiser, not the emitter. If the offending function name is unreliable, maybe we should omit it and issue a "value returned from form is not used" warning. What do you think?