Comment 0 for bug 924276

Revision history for this message
Jan Moringen (scymtym) wrote : Bogus style-warning caused by declarations within empty macrolet

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 referes 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 http://paste.lisp.org/display/127388):

* (compile nil `(lambda (a) (symbol-macrolet ((b 1))
      (declare (ignorable a))
      :c)))
#<FUNCTION (LAMBDA (A)) {100DA7F9FB}>
NIL
NIL

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

; (LAMBDA (A)
; (SYMBOL-MACROLET ()
; (DECLARE (IGNORABLE A))
; :C))
;
; caught STYLE-WARNING:
; The variable A is defined but never used.
;
; compilation unit finished
; caught 2 STYLE-WARNING conditions
#<FUNCTION (LAMBDA (A)) {100E6DB98B}>
T
NIL

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

*FEATURES*:

(:SB-CORE-COMPRESSION :ANSI-CL :COMMON-LISP :SBCL :SB-DOC :SB-TEST :SB-LDB
 :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL :SB-SOURCE-LOCATIONS
 :IEEE-FLOATING-POINT :OS-PROVIDES-POLL :OS-PROVIDES-GETPROTOBY-R
 :OS-PROVIDES-SUSECONDS-T :OS-PROVIDES-PUTWC :OS-PROVIDES-DLADDR
 :OS-PROVIDES-DLOPEN :LITTLE-ENDIAN :MULTIPLY-HIGH-VOPS :MEMORY-BARRIER-VOPS
 :INLINE-CONSTANTS :FLOAT-EQL-VOPS :COMPLEX-FLOAT-VOPS :CYCLE-COUNTER
 :ALIEN-CALLBACKS :STACK-ALLOCATABLE-FIXED-OBJECTS :STACK-ALLOCATABLE-LISTS
 :STACK-ALLOCATABLE-VECTORS :STACK-ALLOCATABLE-CLOSURES :RAW-INSTANCE-INIT-VOPS
 :UNWIND-TO-FRAME-AND-CALL-VOP :COMPARE-AND-SWAP-VOPS :LINKAGE-TABLE
 :C-STACK-IS-CONTROL-STACK :STACK-GROWS-DOWNWARD-NOT-UPWARD :GENCGC :LARGEFILE
 :SB-FUTEX :SB-THREAD :LINUX :ELF :UNIX :X86-64)