Steel Bank Common Lisp

Style warning from inline function defined within macrolet

Reported by Stephen Bach on 2010-02-19
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
High
Unassigned

Bug Description

I'm seeing what appears to be a specious style warning from
SBCL-generated code:

; compiling (DEFUN SOME-FUNCTION ...); in: LAMBDA NIL
; #'(LAMBDA (#:WHOLE612 #:ENVIRONMENT613)
; (SB-EVAL::PROGRAM-DESTRUCTURING-BIND (#:NAME614 NAME) #:WHOLE612
; (DECLARE (IGNORE #:NAME614))
; (BLOCK DEFUN-INLINE
; `(PROGN
; (PROCLAIM '#)
; (DECLAIM #)
; (DEFUN ,NAME # NIL)))))
;
; caught STYLE-WARNING:
; The variable #:ENVIRONMENT613 is defined but never used.

A small test case is attached:

  1. definition.lisp defines a simple macrolet to wrap DEFUN with inline
     declarations and expands it once for a sample function.
  2. call.lisp defines a minimal function which calls the function from
     (1).
  3. loader.lisp interprets definition.lisp and then compiles call.lisp,
     resulting in the above style-warning.

Removing the inlining declarations prevents the style warning. Tested
on SBCL 1.0.35 and a few older versions.

$ uname -a

2.6.26-2-amd64 #1 SMP Tue Jan 12 22:12:20 UTC 2010 x86_64 GNU/Linux

Nikodemus Siivola (nikodemus) wrote :

This is due to FUNCTION-LAMBDA-EXPRESSION not dealing correctly with declarations in inlined functions. Attached patch fixes this, committing after freeze.

Changed in sbcl:
status: New → In Progress
importance: Undecided → High

 status fixcommitted

In SBCL 1.0.36.3.

Changed in sbcl:
status: In Progress → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers