bogus lack of style warning with non-empty symbol-macrolet

Bug #924276 reported by Jan Moringen on 2012-01-31
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

A description of what you do, what happens, and what you expected to happen:

When compiling a lambda containing an empty macrolet containing an ignorable declaration, the compiler produces a seemingly bogus style-warning which refers to the declaration. The compiler should not produce such bogus warnings. The warning disappears when the macrolet has one or more bindings.

A complete repeatable test-case (also at

* (compile nil `(lambda (a) (symbol-macrolet ((b 1))
      (declare (ignorable a))

* (compile nil `(lambda (a) (symbol-macrolet ()
      (declare (ignorable a))
; in: LAMBDA (A)
; IGNORABLE declaration for an unknown variable: A

; :C))
; The variable A is defined but never used.
; compilation unit finished
; caught 2 STYLE-WARNING conditions

SBCL version as reported by "sbcl --version":

SBCL 1.0.55

Output from uname -a:

Linux azurit 2.6.35-30-generic #53-Ubuntu SMP Sun Jun 5 04:00:23 UTC 2011 x86_64 GNU/Linux



Jan Moringen (scymtym) on 2012-01-31
description: updated
Stas Boukarev (stassats) wrote :

IGNORABLE is a bound declaration, it should appear directly after the form which introduces a binding. It should be
(lambda (a)
  (declare (ignorable a))
  (symbol-macrolet ()

Changed in sbcl:
status: New → Invalid

 summary "bogus lack of style warning with non-empty symbol-macrolet"
 status confirmed

Something got mangled. The original report was at
<>, and the problem I saw in it was:

 CL-USER> (compile nil `(lambda (a) (symbol-macrolet ((b 1))
                                      (declare (ignorable a))

with no style-warnings, in contrast with the empty symbol-macrolet which
does correctly give the style warning.


summary: - Bogus style-warning caused by declarations within empty macrolet
+ bogus lack of style warning with non-empty symbol-macrolet
Changed in sbcl:
status: Invalid → Confirmed
Nikodemus Siivola (nikodemus) wrote :

Ouch. MAKE-LEXENV uses NCONC on it's argument.

Replacing things with APPEND seems to take care of this... remains to be seen if anything breaks by doing that.

Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
importance: Undecided → Medium
status: Confirmed → In Progress
Nikodemus Siivola (nikodemus) wrote :

commit 09cbe389732a42a2eaeaa5fbe3847a95a10c996e
Author: Nikodemus Siivola <email address hidden>
Date: Thu Mar 29 18:31:58 2012 +0300

    MAKE-LEXENV used NCONC on its arguments, which callers did not expect

      Fixes lp#924276.

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
Nikodemus Siivola (nikodemus) wrote :

in SBCL 1.0.57

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