emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 7e294d5: Remove some obsolete integer overflow


From: Pip Cet
Subject: Re: [Emacs-diffs] master 7e294d5: Remove some obsolete integer overflow handling
Date: Mon, 22 Jul 2019 23:19:01 +0000

On Mon, Jul 22, 2019 at 5:28 PM Mattias Engdegård
<address@hidden> 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: 0001-Avoid-byte-compiler-warning-for-subr.el.patch
Description: Source code patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]