Style warning from inline function defined within macrolet
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
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:
; (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
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
This is due to FUNCTION- LAMBDA- EXPRESSION not dealing correctly with declarations in inlined functions. Attached patch fixes this, committing after freeze.