1.0.36.22: bogus style-warning in DEFSTRUCT edge-case
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 12 Mar 2010 11:23:09 +0000 (11:23 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 12 Mar 2010 11:23:09 +0000 (11:23 +0000)
 * Using initformless &AUX to specify uninitialized structure slots
   caused a bogus style-warning.

   Patch by: Adlai Chandrasekhar <Munchking@gmail.com>

 Fixed launchpad bug #528807.

NEWS
src/code/defstruct.lisp
tests/defstruct.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index b85c0c0..cb5bb9b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -37,6 +37,8 @@ changes relative to sbcl-1.0.36:
     SB-EXT:RESTRICT-COMPILER-POLICY into account. (lp#313337)
   * bug fix: Comma inside a backquoted array or structure resulted in nonsense
     values instead of signaling an error. (lp#309093)
+  * bug fix: Spurious unused variale warning in a DEFSTRUCT edge case.
+    (lp#528807)
 
 changes in sbcl-1.0.36 relative to sbcl-1.0.35:
   * new feature: SB-EXT:TYPEXPAND-1, SB-EXT:TYPEXPAND, and
index a7dfff4..76f3c83 100644 (file)
         (when auxp
           (arglist '&aux)
           (dolist (arg aux)
-            (arglist arg)
             (if (proper-list-of-length-p arg 2)
-              (let ((var (first arg)))
-                (vars var)
-                (types (get-slot var)))
-              (skipped-vars (if (consp arg) (first arg) arg))))))
+                (let ((var (first arg)))
+                  (arglist arg)
+                  (vars var)
+                  (types (get-slot var)))
+                (skipped-vars (if (consp arg) (first arg) arg))))))
 
       (funcall creator defstruct (first boa)
                (arglist) (vars) (types)
index 7f2ba08..e84e4f3 100644 (file)
@@ -1065,3 +1065,9 @@ redefinition."
 (with-test (:name defstruct-copier-typechecks-argument)
   (assert (not (raises-error? (copy-person (make-astronaut :name "Neil")))))
   (assert (raises-error? (copy-astronaut (make-person :name "Fred")))))
+
+(with-test (:name :bug-528807)
+  (let ((*evaluator-mode* :compile))
+    (handler-bind ((style-warning #'error))
+      (eval `(defstruct (bug-528807 (:constructor make-528807 (&aux x)))
+               (x nil :type fixnum))))))
index de81b35..6ef80a7 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.36.21"
+"1.0.36.22"