From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#6740: Spurious byte compiler warnings Date: Tue, 27 Jul 2010 21:23:28 +0000 Message-ID: <20100727212328.GD2280@muc.de> References: <20100727200619.GC2280@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1280266719 23611 80.91.229.12 (27 Jul 2010 21:38:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 27 Jul 2010 21:38:39 +0000 (UTC) Cc: 6740@debbugs.gnu.org To: Dan Nicolaescu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 27 23:38:37 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Odrr7-0000sF-Eu for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jul 2010 23:38:33 +0200 Original-Received: from localhost ([127.0.0.1]:37880 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Odrr6-0005gl-N3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 27 Jul 2010 17:38:32 -0400 Original-Received: from [140.186.70.92] (port=51347 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdrqI-0005IW-0z for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2010 17:37:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OdrqH-0000po-17 for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2010 17:37:42 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40467) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdrqG-0000pi-Vh for bug-gnu-emacs@gnu.org; Tue, 27 Jul 2010 17:37:40 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OdrSP-0000wA-N8; Tue, 27 Jul 2010 17:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Jul 2010 21:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6740 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6740-submit@debbugs.gnu.org id=B6740.12802651353591 (code B ref 6740); Tue, 27 Jul 2010 21:13:01 +0000 Original-Received: (at 6740) by debbugs.gnu.org; 27 Jul 2010 21:12:15 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdrRe-0000vs-6l for submit@debbugs.gnu.org; Tue, 27 Jul 2010 17:12:14 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdrRc-0000vm-KL for 6740@debbugs.gnu.org; Tue, 27 Jul 2010 17:12:13 -0400 Original-Received: (qmail 33688 invoked by uid 3782); 27 Jul 2010 21:12:20 -0000 Original-Received: from acm.muc.de (pD9E52785.dip.t-dialin.net [217.229.39.133]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 27 Jul 2010 23:12:19 +0200 Original-Received: (qmail 4735 invoked by uid 1000); 27 Jul 2010 21:23:28 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Tue, 27 Jul 2010 17:13:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:38997 Archived-At: Hi, Dan, On Tue, Jul 27, 2010 at 04:26:03PM -0400, Dan Nicolaescu wrote: > Alan Mackenzie writes: > > Hi, Emacs! > > (i) Start Emacs, even a most recent bzr version, with -Q. > > (ii) Put the following into the *scratch* buffer: > > (eval-when-compile > > (if (and (not (featurep 'cc-fix)) > > (featurep 'xemacs) > > (progn > > (require 'font-lock) > > (let (font-lock-keywords) > > (font-lock-compile-keywords '("\\<\\>")) > > font-lock-keywords))) > > (cc-load "cc-fix"))) > > (This fragment is at the top level, and taken from cc-defs.el.). > > (iii) do M-x compile-defun on this form. > > The byte compiler then issues the following two identical error > > messages: > > Warning: value returned from (featurep (quote cc-fix)) is unused > > Warning: value returned from (featurep (quote cc-fix)) is unused > > It is obvious that that value is indeed used. This is a bug. > The byte compiler knows that (featurep 'xemacs) is false, so > (and (not (featurep 'cc-fix)) ... ) > will be false, so the featurep result is indeed unused. Ah, thanks for the explanation! But ..... It's a bug that the error message is repeated, at the very least. And the message is most assuredly false because (featurep 'cc-fix) isn't always false - for example when it's run under XEmacs. > If you use (and (featurep 'xemacs) (not (featurep 'cc-fix) ... > the warning will go away. At the very least, emitting such arcane warnings is unhelpful. Are there any circumstances in which such a warning might help a hacker improve his code? Surely we aren't in the business of making it difficult to adapt code for XEmacs? I think it's clear, the only code containing (featurep 'xemacs) is portable code. Can we please remove this unhelpful warning? -- Alan Mackenzie (Nuremberg, Germany).