From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Compilation warnings of ELisp seem wrong and misleading Date: Mon, 30 Mar 2015 18:59:36 +0200 Message-ID: <20150330165935.GA11134@tuxteam.de> References: <87619iy2g9.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1427734863 25630 80.91.229.3 (30 Mar 2015 17:01:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Mar 2015 17:01:03 +0000 (UTC) Cc: "Pascal J. Bourguignon" , "help-gnu-emacs@gnu.org" To: "Ludwig, Mark" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 30 19:01:01 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ycd3b-00075I-PD for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Mar 2015 19:00:59 +0200 Original-Received: from localhost ([::1]:35202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycd3b-0001ni-7v for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Mar 2015 13:00:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46910) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycd2N-0000st-Bq for help-gnu-emacs@gnu.org; Mon, 30 Mar 2015 12:59:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ycd2I-00028c-Uz for help-gnu-emacs@gnu.org; Mon, 30 Mar 2015 12:59:43 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:53913 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycd2I-00027q-Q6 for help-gnu-emacs@gnu.org; Mon, 30 Mar 2015 12:59:38 -0400 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1Ycd2G-00035R-3p; Mon, 30 Mar 2015 18:59:36 +0200 In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103456 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Mon, Mar 30, 2015 at 03:40:21PM +0000, Ludwig, Mark wrote: > "Pascal J. Bourguignon" wrote: > > > "Ludwig, Mark" writes: > > > > > Greetings, > > > > > > I've been using an ancient Emacs (19.29) on Solaris and finally > > > got around to installing a current one (24.4). > > > > > > I find my custom Elisp generates warnings that seem pretty stupid. > > > For example: > > > > > > emacs.el:255:10:Warning: reference to free variable `if' Bizarre. > For context, the "let*" is on line 239; the warning > (mentioned above as being on line 255 column 10) is > referring to the form after the comment "Make the > substitution." If you read the warnings carefully, you'll > note that it warns about two different things on line 261, > column 17. That line is the one with the comment, 'Now it's > "strlcpy" or whatever.' Clearly, the byte-compiler is > pretty confused.... At first blush, to me the following looks fishy: > (let* ((c1 (string-to-char to1)) > (c2 (string-to-char to2)) > (ans 0)) [...] > (cond ((= ans ?d) > ;; Skip over: "if" "(DSOK)" "dstat" "= ..." "()" > (forward-sexp 5) > ) > > ((= ans ?e) > ;; Skip over: > ;; "if" "(dstat = ...)" "goto" "EXIT" > (forward-sexp 4) > ) > > (if (not (looking-at ";")) > (error "First expected ';' not: \"%s\"" (buffer-substring (point) Here: you're in the middle of a `cond' and the clause reads "(if ...)". I'd expect `cond' to try to interpret "if" as a naked variable (granted, the error message points at another place). > (progn (end-of-line 1) > (point))))) > (save-excursion > (goto-char if-pos) ; Go back to where we inserted "if" > (insert "{ ...likewise the `save-excursion' here. And so on. HTH - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlUZgPcACgkQBcgs9XrR2kYznQCfa2FWYAipjWHgTbfS0lR4BV2L TKAAniQtR5ddvmg1extvIKl5ZnkOeF1C =KuKr -----END PGP SIGNATURE-----