GNU bug report logs - #16206
24.3; Incorrect unused variable byte-compiler warning in dotimes

Previous Next

Package: emacs;

Reported by: Christopher Wellons <wellons <at> nullprogram.com>

Date: Fri, 20 Dec 2013 21:08:01 UTC

Severity: minor

Merged with 31232, 39919, 41287

Found in versions 24.3, 26.3, 28.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Juri Linkov <juri <at> linkov.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#31232: closed (27.0.50; Obsolete argument RESULT in the macro
 `dotimes')
Date: Sat, 28 Apr 2018 20:22:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 28 Apr 2018 23:21:05 +0300
with message-id <87r2mzf5fy.fsf <at> mail.linkov.net>
and subject line Re: bug#16206: 24.3; Incorrect unused variable byte-compiler warning in dotimes
has caused the debbugs.gnu.org bug report #16206,
regarding 27.0.50; Obsolete argument RESULT in the macro `dotimes'
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
16206: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16206
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Obsolete argument RESULT in the macro `dotimes'
Date: Sat, 21 Apr 2018 23:53:44 +0300
If the arg RESULT of dotimes is not yet deprecated,
then to legitimize its usage it needs to be fixed.
At least, this patch tries to do this (maybe not in the best way):

diff --git a/lisp/subr.el b/lisp/subr.el
index 9cf7d59..aa2dc49 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -246,8 +246,8 @@ dotimes
                  ,@body)
                (setq ,counter (1+ ,counter)))
              ,@(if (cddr spec)
-                   ;; FIXME: This let often leads to "unused var" warnings.
-                   `((let ((,(car spec) ,counter)) ,@(cddr spec))))))
+                   ;; No-op ,(car spec) is added to avoid "unused var" warnings.
+                   `((let ((,(car spec) ,counter)) ,(car spec) ,@(cddr spec))))))
       `(let ((,temp ,end)
              (,(car spec) ,start))
          (while (< ,(car spec) ,temp)


[Message part 3 (message/rfc822, inline)]
From: Juri Linkov <juri <at> linkov.net>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: Christopher Wellons <wellons <at> nullprogram.com>, 16206-done <at> debbugs.gnu.org
Subject: Re: bug#16206: 24.3;
 Incorrect unused variable byte-compiler warning in dotimes
Date: Sat, 28 Apr 2018 23:21:05 +0300
Version: 27.0.50

>> But without that addition the sentence makes no sense when
>> the documentation describes the RESULT argument and then
>> at the end says that "RESULT should not be used".
>
> "Its use is deprecated".

Done in f4eeb0f.


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

Previous Next


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