Steel Bank Common Lisp

Spurious warning in a DEFSTRUCT edge case

Reported by Adlai Chandrasekhar on 2010-02-27
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

This code should compile cleanly, but there's a warning:

* (defstruct (foo (:constructor make-foo (&aux x)))
    (x nil :type fixnum))
; in: LAMBDA NIL
; (SB-INT:NAMED-LAMBDA MAKE-FOO
; (&AUX X)
; (DECLARE)
; (BLOCK MAKE-FOO
; (SB-KERNEL::%MAKE-STRUCTURE-INSTANCE-MACRO
; #<SB-KERNEL:DEFSTRUCT-DESCRIPTION FOO> 'NIL)))
; ==>
; #'(SB-INT:NAMED-LAMBDA MAKE-FOO
; (&AUX X)
; (DECLARE)
; (BLOCK MAKE-FOO
; (SB-KERNEL::%MAKE-STRUCTURE-INSTANCE-MACRO
; #<SB-KERNEL:DEFSTRUCT-DESCRIPTION FOO> 'NIL)))
;
; caught STYLE-WARNING:
; The variable X is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition

FOO

Attached is a quick patch to src/code/defstruct.lisp.

Adlai Chandrasekhar (adlai) wrote :
Changed in sbcl:
status: New → Confirmed
importance: Undecided → Low

  status fixcommited

Thanks for the patch! In SBCL 1.0.36.22.

Nikodemus Siivola (nikodemus) wrote :

 status fixcommitted

Thanks for the patch! In SBCL 1.0.36.22.

Changed in sbcl:
status: Confirmed → 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