[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MIT-Scheme-devel] Re: false positive: unreferenced bound variable
From: |
Joe Marshall |
Subject: |
[MIT-Scheme-devel] Re: false positive: unreferenced bound variable |
Date: |
Wed, 17 Mar 2010 02:59:48 -0700 |
Where?
In cpress.scm,
; Integrating procedure guarantee-buffer-space...
;Warning: Unreferenced bound variable: nb (guarantee-buffer-space)
; ... done
The code is complex, but note this:
(define-integrable buffer-size-optimal? true)
(define (guarantee-buffer-space nb)
;; Make sure that the byte buffer has enough space to hold NB bytes.
;; If necessary, invalidate old commands until this is true. If the
;; buffer size is optimal, this is never necessary, because the
;; buffer is big enough to hold all of the commands in the window.
(if (and (not buffer-size-optimal?)
oldest-node)
(let ((end (bb-end byte-buffer)))
(if (fix:< (let ((bp command-bp))
... lots of code elided ...
Since buffer-size-optimal? is true, the conditional can be eliminated and
this turns into
(define (guarantee-buffer-space nb)
#!unspecific)
Which doesn't use nb.
In edwin\win32.scm there is this code:
(define (win32-screen/scroll-lines-down! screen xl xu yl yu amount)
(and #f
(win32-screen-vertical-scroll! (screen->handle screen)
xl xu yl yu (fix:+ yl amount))))
The second arm of the AND is dead code, so the variables are not being used.
On Wed, Mar 17, 2010 at 12:57 AM, Chris Hanson <address@hidden> wrote:
> The new SF is generating unreferenced bound variables in situations
> where the variables are referenced. In the two cases I looked at,
> both involved conditionals in which the variable was referenced on one
> arm of the conditional but not the other.
>
--
~jrm