Style warning from inline function defined within macrolet

Bug #524707 reported by Stephen Bach
8
This bug affects 1 person
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::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

Revision history for this message
Stephen Bach (sbach-itasoftware) wrote :
Revision history for this message
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
Revision history for this message
Nikodemus Siivola (nikodemus) wrote : Re: [Bug 524707] [NEW] Style warning from inline function defined within macrolet

 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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.