GNU bug report logs - #6740
Spurious byte compiler warnings

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Tue, 27 Jul 2010 19:56:01 UTC

Severity: minor

Full log


Message #8 received at 6740 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: Alan Mackenzie <acm <at> muc.de>
Cc: 6740 <at> debbugs.gnu.org
Subject: Re: bug#6740: Spurious byte compiler warnings
Date: Tue, 27 Jul 2010 16:26:03 -0400
Alan Mackenzie <acm <at> muc.de> 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.

If you use (and (featurep 'xemacs) (not (featurep 'cc-fix) ...
the warning will go away.




This bug report was last modified 4 years and 202 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.