all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pip Cet <pipcet@gmail.com>
To: emacs-devel@gnu.org, "Mattias Engdegård" <mattiase@acm.org>
Subject: Re: [Emacs-diffs] master 7e294d5: Remove some obsolete integer overflow handling
Date: Mon, 22 Jul 2019 23:19:01 +0000	[thread overview]
Message-ID: <CAOqdjBfLhMsLYMEZ2_OwMD9hiB8jJ9=5tr8O9fjK1c2qiA5Qmw@mail.gmail.com> (raw)
In-Reply-To: <20190722172805.DA95520BE2@vcs0.savannah.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1172 bytes --]

On Mon, Jul 22, 2019 at 5:28 PM Mattias Engdegård
<mattiase@savannah.gnu.org> wrote:
> diff --git a/lisp/subr.el b/lisp/subr.el
> index 4a1649f..9fd3366 100644
> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -681,14 +681,12 @@ of course, also replace TO with a slightly larger value
>      (when (zerop inc) (error "The increment can not be zero"))
>      (let (seq (n 0) (next from) (last from))
>        (if (> inc 0)
> -          ;; The (>= next last) condition protects against integer
> -          ;; overflow in computing NEXT.
> -          (while (and (>= next last) (<= next to))
> +          (while (<= next to)
>              (setq seq (cons next seq)
>                    n (1+ n)
>                    last next
>                    next (+ from (* n inc))))
> -        (while (and (<= next last) (>= next to))
> +        (while (>= next to)
>            (setq seq (cons next seq)
>                  n (1+ n)
>                  next (+ from (* n inc)))))

This causes a warning here:

  ELC      ../lisp/subr.elc

In toplevel form:
subr.el:655:1:Warning: Unused lexical variable ‘last’

which is fixed by the attached patch.

[-- Attachment #2: 0001-Avoid-byte-compiler-warning-for-subr.el.patch --]
[-- Type: application/x-patch, Size: 964 bytes --]

       reply	other threads:[~2019-07-22 23:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190722172804.7625.94762@vcs0.savannah.gnu.org>
     [not found] ` <20190722172805.DA95520BE2@vcs0.savannah.gnu.org>
2019-07-22 23:19   ` Pip Cet [this message]
2019-07-23  0:47     ` [Emacs-diffs] master 7e294d5: Remove some obsolete integer overflow handling Paul Eggert
2019-07-23  9:03       ` Mattias Engdegård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOqdjBfLhMsLYMEZ2_OwMD9hiB8jJ9=5tr8O9fjK1c2qiA5Qmw@mail.gmail.com' \
    --to=pipcet@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=mattiase@acm.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.