Spurious warning in a DEFSTRUCT edge case

Bug #528807 reported by Adlai Chandrasekhar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
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.

Revision history for this message
Adlai Chandrasekhar (adlai) wrote :
Changed in sbcl:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Nikodemus Siivola (nikodemus) wrote : Re: [Bug 528807] [NEW] Spurious warning in a DEFSTRUCT edge case

  status fixcommited

Thanks for the patch! In SBCL 1.0.36.22.

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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